Replace your alert destinations
/v1/me/alert-destinations in the Alert Destinations API.
Takes the complete list you want to keep; anything not in it is removed. Each entry names a kind, a target and optional classes:
curl -X PUT https://api.example.test/v1/me/alert-destinations \ -H "Authorization: Bearer $TOKEN" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{ "destinations": [ { "kind": "telegram", "target": "123456789", "classes": ["approvals", "assignments", "mentions", "incidents"] }, { "kind": "email", "target": "priya@example.com", "classes": null } ] }'The response is the resulting list. PUT is a replacement, not a patch: send an empty destinations list to remove every row and return to the default. is_primary in the payload is ignored; the service derives it from your Telegram link.
When an alert is sent, the Telegram chat receives a message when it is routed to the alert's class, and email is used when an email destination routes the class, when nothing else does, or when the class is critical. The same routing decides whether the bot messages you at all: a class you route away from the chat is never sent there. Quiet hours set in the app delay what is not critical.
Requires ability
The token must hold this ability, or the call is refused with 403.
Idempotent
Send the header on every call; the same key replays the original response for 24 hours.
Authorization
bearerToken A personal access token minted in the app under Account Settings, then API Tokens, sent as Authorization: Bearer zg_live_…. The token carries the abilities each endpoint lists under Requires ability and is frozen to one team, and optionally to one project, at mint time.
In: header
Header Parameters
A key unique to this operation, such as a fresh UUID. The same key replays the original 2xx response for 24 hours (with Idempotent-Replay: true), so a retry after a timeout never repeats the write; the same key with a different body is refused with 409.
uuidRequest body
JSONWhat the request carriesRequiredapplication/json
The complete set of alert destinations to keep. Anything not listed is removed; an empty list returns you to the default routing.
Responses
200OKapplication/json
Array of AlertDestinationResource
400Bad requestIDEMPOTENCY_KEY_MISSINGapplication/json
Every write needs an Idempotency-Key header. Send a fresh UUID per distinct operation.
401UnauthorizedAUTHENTICATION_REQUIREDapplication/json
The request carries no bearer token, or one that is revoked, malformed, or minted for another environment (a zg_test_ token on production).
403ForbiddenTOKEN_MISSING_ABILITYapplication/json
The token is valid but does not carry the ability this endpoint requires; error.context.required_ability names the one to grant. An endpoint that also checks who registered a row answers FORBIDDEN with the same status, and says so in its own description.
404Not foundRESOURCE_NOT_FOUNDapplication/json
When a target is not your own linked chat or your own address; nothing is written.
409ConflictIDEMPOTENCY_KEY_REUSEDapplication/json
The key was already used in the last 24 hours with a different request body.
422Validation failedVALIDATION_FAILEDapplication/json
The payload broke a rule, and error.fields maps each offending key to its messages. A refusal from the domain, such as a role code already taken or a team the caller does not own, uses the same code with error.message saying why and no fields.
On this endpoint: VALIDATION_FAILED: when destinations is missing, holds more than 20 entries, or an entry has an unknown kind or class.
425Too earlyIDEMPOTENCY_REPLAY_IN_PROGRESSapplication/json
The first request with this key is still running; retry in a few seconds and the original response is replayed.
429Too many requestsRATE_LIMITEDapplication/json
The token has spent its 300 requests a minute or 10,000 an hour; Retry-After says when the next one is accepted.
How is this guide?
Last updated on
List your alert destinations
/v1/me/alert-destinations in the Alert Destinations API.
Approvals API
An approval request is one time a planning record was put up for approval: an epic, a story, a requirement, a business rule or a use case, a baseline or a change request, submitted by its author and decided by the approvers the project's policy names for that kind of approval.