COPS

Create notification subscription

POST
/notifications/subscriptions

Send chosen events to a destination (Discord, Slack, Email, or Custom webhook), for example new creators or the daily digest. After you create it, call send_test_notification to check that the destination works. Pass idempotencyKey so a retry does not make a duplicate.

Authorization

apiKeyAuth
headerx-api-key<token>

API key for authentication. Keys are prefixed with cops_.

Request Body

application/json
  1. body
channel*string

discord_webhook: a Discord channel webhook URL. slack_webhook: a Slack incoming-webhook URL. email: your own account email; needs personal: true. custom_webhook: any public https endpoint, signed with Standard Webhooks headers when a secret is set.

Value in"discord_webhook""slack_webhook""email""custom_webhook"
destination?string

The webhook URL. Write-only: it is never returned. Not needed for a personal email subscription, which always sends to your account email.

eventTypes?array<>

Event type keys from list_notification_event_types. An empty list sends every instant event, or with campaignIds every instant campaign event; a digest is sent only when listed.

Default[]
eventOptions?

Options for the event types in eventTypes, keyed by event type. The optionsSchema of each event type in list_notification_event_types gives its options and their defaults; an option you leave out uses its default.

Default{}
campaignIds?array<string>

Only send events about these campaigns (ids from list_campaigns). A campaign filter works only with event types whose scope is campaign in list_notification_event_types. An empty list means no filter.

Default[]
secret?|

custom_webhook only: the signing secret (whsec_ followed by base64 is recommended). Write-only; null removes it.

customHeaders?|

custom_webhook only: extra request headers as name to value. Write-only; null removes them.

label?|

Display name for the destination. The daily digest uses it as a title prefix.

personal?boolean

true: an email subscription owned by you, sent to your account email and hidden from other members. Required for the email channel.

Defaultfalse
idempotencyKey?string

Any unique string for this request. A retry with the same key returns the first result instead of doing it again.

Length1 <= length <= 200

Response Body

Response schema unavailable.

Example Request
curl -X POST 'https://cops.app/api/brand/notifications/subscriptions' \  -H 'Content-Type: application/json' \  -d '{  "channel": "discord_webhook"}'
Example Response200
Empty