Create a subscription

Creates one dashboard, report, or commitment subscription with one, two, or three scheduled subscriptions: dashboard-subscription, report-subscription, and commitment-manager. Create does not accept alert or budget. Each type appears at most once. The response is that subscription. Nested entries are ordered by type. name is {source name} (Dashboard Subscription), (Report Subscription), or (Commitment Subscription), taken from the nested type that sorts first. createdBy is the caller.
subscriptions must contain one to three entries. A repeated type is 422 customers.duplicate_subscription_type. An alert or budget type, an empty subscriptions array, or any server-set field (id, name, createdBy, etag, permissions, source.name, schedule.nextAt) is 422 validation_failed. source.id must belong to the tenant. A missing or foreign source is 422 validation_failed. Recipient and schedule value rules are on CustomerSubscriptionRecipients and CustomerSubscriptionScheduleInput.
The caller must be allowed to manage every sent type: a DoiT employee, Manage Settings, or the permission for that type. Users Manager alone grants no access.
Idempotency-Key is required. The same key, caller, customer, method, path, and body replays the stored success response. A different body for that key is 422 idempotency_key_reused. A missing key is 400 idempotency_key_required. While the first request is in progress, another request with that key is 409 idempotency_request_in_progress. A 4xx response releases the key. dryRun=true does not reserve the key. It returns the would-be subscription with id and etag null and writes nothing.
Reads are immediately consistent. After a 201, a GET of that id returns the created subscription. The first delivery can take up to an hour.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Query Params
boolean
Defaults to false

If true, validates the request and returns the would-be result without applying it. The response then carries the X-Dry-Run header.

Body Params

Writable fields of a new subscription. One to three scheduled types, each at most once. Both recipient arrays are required.

Fields of a new subscription. Unknown fields and server-set fields are rejected. subscriptions has one, two, or three scheduled types, each at most once. Both recipient arrays are required, and at least one address is required.

recipients
object
required

Delivery targets. Both arrays are required.

subscriptions
array of objects
required
length between 1 and 3

Scheduled subscriptions to store on the new subscription. The server sorts them by type ascending. Request order is not stored and is not significant. A change of only that order does not write. The response is ordered by type, not by this request.

subscriptions*

One scheduled subscription to create. type is dashboard-subscription, report-subscription, or commitment-manager, and each type appears once. attachments and pdfSettings are accepted only when type is report-subscription. Omitted attachments stores []. Omitted pdfSettings stores all true. A duplicate or unknown attachment value is 422.

string
enum
required

Scheduled subscription type.

Show Details
commitment-managerCommitment subscription. Scheduled delivery of a commitment in Commitment manager.
dashboard-subscriptionDashboard subscription. Scheduled email or Slack delivery of a dashboard.
report-subscriptionReport subscription. Scheduled email or Slack delivery of a report.
Allowed:
source
object
required

Source to attach. Must belong to the tenant.

schedule
object
required

Delivery schedule.

attachments
array of objects, unique

Files to attach to the report email. Report only. Omitted stores an empty list.

pdfSettings
object

PDF rendering options. Report only. Omitted stores all true.

Headers
string
required
length between 1 and 255

Client-generated key (UUID v4 or ULID recommended). Retrying with the same key and request returns the stored response instead of repeating the operation; the key is kept for 24 hours.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json