Update a subscription

Partially updates one dashboard, report, commitment, alert, or budget subscription with an application/merge-patch+json body (RFC 7396). The writable fields are recipients.emails, recipients.slackChannels, and, on a scheduled subscription, subscriptions. Any other field, recipients: null, or null for either recipient list is 422 validation_failed. A patch that sets neither recipients nor subscriptions is 422 validation_failed. A wrong Content-Type is 415. Recipient and schedule value rules are on CustomerSubscriptionRecipients, CustomerSubscriptionRecipientPatch, and CustomerSubscriptionScheduleInput.
On a scheduled subscription, subscriptions is the desired set of dashboard, report, and commitment subscriptions. A type in the body and not on the document is added. A type on the document and missing from the body is removed. A type in both is updated when source.id or the schedule differs, and nextAt is recalculated. A stored entry this API does not list stays on the subscription. An empty subscriptions array is 422 validation_failed; deleting the item is DELETE. A repeated type is 422 customers.duplicate_subscription_type. An omitted subscriptions array leaves the nested types unchanged.
Create does not accept alert or budget. GET returns them. On an alert or a budget, subscriptions is accepted only when it is the one stored entry with the same type and source.id and no schedule. Any other array is 422 validation_failed. Those items never gain a dashboard, report, or commitment subscription. Alerts and budgets keep their own APIs for create, delete, and full management. This PATCH is the one write this API makes on them, and it may replace their recipient lists. DELETE of an alert or a budget returns 409 customers.entry_is_resource.
A patch whose normalized values match the stored values returns 200 and does not write. The etag is unchanged.
Recipient changes are allowed when the caller can edit every key on the document, including a key the response did not show. Otherwise they are allowed only when the caller removes exactly their own email: no added address, no Slack change, and no subscription-set change. Any other recipient change is 403. The caller must be allowed to manage every added or changed scheduled type and to delete every removed type.
If-Match must contain the current strong ETag. The token only covers fields this API can write. Idempotency-Key is required. The same key, caller, customer, method, path, body, and If-Match replays the stored success response. A different body or If-Match 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 the current etag and writes nothing.
Reads are immediately consistent. After a completed update, a GET of that id returns the new state.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
length ≥ 1

Subscription id returned by list or create. Ids are independent ids of a scheduled subscription, an alert, or a budget. The server looks up a scheduled subscription, then an alert, then a budget. An id found in more than one of those collections is 409 customers.subscription_id_ambiguous. That is an invariant breach. There is no second identifier to send, and a client cannot disambiguate it. Auto-generated ids do not collide.

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

JSON Merge Patch (RFC 7396). Send recipients, subscriptions, or both. An included recipient array replaces that list. An included subscriptions array is the desired scheduled set.

JSON Merge Patch (RFC 7396) for one subscription. At least one of recipients or subscriptions is required. Omitted fields stay unchanged. null is rejected. Any other field is rejected.

recipients
object

Recipient lists to replace. An omitted list stays.

subscriptions
array of objects
length between 1 and 3

Desired nested subscriptions. The server sorts them by type ascending. Request order is not stored and is not significant. On a scheduled subscription, the scheduled set to store. On an alert or a budget, the one stored entry.

subscriptions

One entry in a subscription-set patch. On a scheduled subscription, type is a scheduled type and schedule is required. On an alert or a budget, the array must be the one stored entry with the same type and source.id and no schedule. On a report subscription, an omitted attachments or pdfSettings stays. A sent attachments array replaces that list, including [] to clear. A sent pdfSettings object replaces all three flags and requires all three. A recipient-only patch must not send these fields. Changing them requires the same permission as a schedule change.

string
enum
required

Nested subscription type.

Show Details
alertAlert entry. One item, and it cannot be deleted through this API.
budgetBudget entry. One item, and it cannot be deleted through this API.
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, or the stored alert or budget id.

schedule
object

Delivery schedule. Required for a scheduled type. Omit it when echoing an alert or a budget.

attachments
array of objects, unique

Replacement attachment list for a report subscription. Omitted keeps the stored list. [] clears it. Rejected on any other type with 422.

pdfSettings
object

Replacement PDF settings for a report subscription. Omitted keeps the stored settings. When sent, all three flags are required. Rejected on any other type with 422.

Headers
string
required

The ETag of the current version, from a get, create or update response. A stale value returns 412; re-read the resource and retry with the new ETag.

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