$API is the API address and $TOKEN the key’s token:
1
Discover the key's units
id (12) and the chain tenant_id (7).2
Find the item by your reference
Look the item up by your own system’s code, in If
external_reference (exact match):data comes back empty, create the item. translations carries the block of the chain’s default language (pt_BR or en), with name required:queue_type sets the alert type: single for a one-time alert (the subscription ends after the first alert) or recurring for a recurring alert (the subscription stays and receives every alert). The 201 response carries the item (abridged):3
Estimate the cost
sufficient is false, the dispatch would be refused with insufficient_credits.4
Send the alert
message takes up to 200 characters; title (up to 120) is optional. To schedule, add scheduled_at in ISO 8601 UTC, within the schedule window from the previous step. Always send a new Idempotency-Key per intended dispatch: if the connection drops and you repeat the call with the same key, the alert doesn’t go out twice (see Idempotency).The 201 response carries the dispatch as pending (or scheduled, if scheduled; dispatched when nobody was subscribed):5
Follow the result
Sending happens in the background. Poll the dispatch until
status leaves pending or processing:dispatched: sent; sent_count and failed_count detail the deliveries and the credits were debited. failed: not sent; failure_reason says why (for example, insufficient_credits at send time). scheduled: waiting for scheduled_at; it can be rescheduled (PATCH) or cancelled (DELETE).If the dispatch is refused
A dispatch may be refused right away, with 422 and acode:
The full list of codes is in Conventions; every endpoint is detailed in the Endpoints group of this tab.