delete-customer-subscription
dci delete-customer-subscription [flags]
Deletes a dashboard, report, or commitment subscription and every scheduled entry on it. Returns 204. Deleting an id that is already gone also returns 204, so a retry does not fail. If-Match is required when the document still exists; a stale value is 412. An id that matches no scheduled subscription, alert, or budget returns 204 when If-Match is present.
Create does not accept alert or budget. GET returns them. PATCH may replace their recipient lists. DELETE of an alert or a budget returns 409 customers.entry_is_resource.
The caller must have canDelete for the subscription. Manage Settings users, a creator with the permission for each scheduled type, and a source owner or editor may delete it. Source viewers and recipients cannot. Users Manager alone grants no access. A service-account token is evaluated from its own permissions and does not inherit the permissions of the subscription creator.
Idempotency-Key is required. The same key, caller, customer, method, path, and If-Match replays the stored success response. A different 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 and does not delete.
Reads are immediately consistent. After a completed delete, a GET of that id returns 404.
Flags
| Flag | Type | Default | Example | Description |
|---|---|---|---|---|
--dry-run | boolean | false | If true, validates the request and returns the would-be result without applying it. The response then carries the X-Dry-Run header. |
Every command also accepts the CLI-wide flags for output shaping — see Output formats and Table output options.
Output
On success, this command produces no response data.
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400, 422 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 409 | 21 | RESOURCE_CONFLICT | The operation conflicts with the resource's current state. |
| 412, 428 | 1 | API_ERROR | The request failed; the printed error message has details. |
| 500 | 40 | API_SERVER_ERROR | The API failed to process the request. Retryable; contact DoiT support if it persists. |
Related
- create-customer-subscription — Create a subscription
- get-customer-subscription — Retrieve a subscription
- list-customer-subscriptions — List subscriptions
- update-customer-subscription — Update a subscription
- API reference: DELETE /customers/v1/subscriptions/{id}
Aliases: deletecustomersubscription