Errors
Every error response, across every endpoint, follows the same flat shape:
json
{ "detail": "Error message describing what went wrong." }Status codes
| Status | Meaning |
|---|---|
400 | Bad request: missing/invalid field, or an unresolvable reference (e.g. no campaign_id/campaign given) |
401 | Missing or invalid access token |
404 | Referenced resource doesn't exist, or doesn't belong to the caller's workspace |
409 | Conflict: e.g. an ambiguous campaign name match, or the campaign isn't in a state that accepts new contacts |
422 | Request was well-formed but rejected by a business rule, most commonly the compliance gate blocking an outbound contact (blacklist, do-not-call, revoked consent) |
A note on 404 vs. cross-workspace access
Endpoints resolve referenced resources (a phone_number_id, a widget_id) within the caller's workspace. Referencing a real resource that belongs to a different workspace returns 404, not 403. The API never confirms whether an id exists outside your workspace.