Cancel a notification
Cancel a scheduled notification before it is released.
DELETE
/v1/notifications/{id}Auth API key:
Authorization: Bearer sk_live_… or sk_test_…Cancels a notification that is still scheduled, so it is never released. Any key of the project can cancel any of its scheduled notifications, live or test. See Scheduling.
- Cancelling costs nothing. A scheduled notification is billed when it is released, so a cancelled one never creates attempts and never counts toward usage.
- Only
schedulednotifications can be cancelled. Once a notification issent, or was alreadycancelledordropped, the request fails with409 NOT_SCHEDULEDand nothing changes. - The cancelled notification stays readable with Get a notification, with
stateset tocancelled.
Request#
Headers#
Authorization
stringrequired
An API key of the project that sent the notification.
- Rules
Bearer sk_live_…orBearer sk_test_…
Path parameters#
id
stringrequired
The
id from the send response.- Rules
- UUID
Response#
200 OK once the notification is cancelled:
id
stringrequired
The notification's id.
- Rules
- UUID
state
stringrequired
The notification's new state.
- Rules
- Always
cancelled
Errors#
| Code | HTTP | When |
|---|---|---|
| UNAUTHORIZED | 401 | The Authorization header is missing, or the key is malformed, unknown or revoked. |
| FORBIDDEN | 403 | A live key was sent from a browser: the request carries an Origin header. Call the API from your server, or use a test key. |
| PROJECT_SUSPENDED | 403 | The key's project is suspended. |
| NOT_FOUND | 404 | The id is not a UUID, belongs to another project, or the notification was deleted after 90 days. |
| NOT_SCHEDULED | 409 | The notification is not scheduled: it was already released, cancelled or dropped. |
| RATE_LIMITED | 429 | The key, project or account went over its per-minute limit. Cancels count like sends. |
| INTERNAL_ERROR | 500 | Something failed on Push's side. It is safe to retry. |
Example#
⫻
curl
⫻
200 OK
Cancelling a notification that was already released:
⫻
409 Conflict