API Reference · Introduction
Errors
Daffy Voice uses standard HTTP status codes. A 2xx means it worked; anything else comes with a JSON body that says what went wrong, in words you can show to a person.
Error format
Most errors return a single detail message:
{ "detail": "Campaign not found" }When the request body itself is malformed — a required field is missing, or a value has the wrong type — the status is 422 and detail is a list, one entry per problem. loc points at the field:
{
"detail": [
{
"type": "missing",
"loc": ["body", "agent_id"],
"msg": "Field required",
"input": { "name": "October EMI reminders" }
}
]
}Check the type of detail
422 errors are checks Daffy Voice makes itself (for example "Invalid agent_id"), and those return detail as a string. Handle both a string and a list.Rate-limit errors are the one exception to this format — see 429 below.
Status codes
Codes the API returns
200 OKSuccess201 CreatedSuccess204 No ContentSuccess400 Bad RequestYour request"Invalid id"), or a contacts CSV that can't be read.401 UnauthorizedYour key403 ForbiddenYour key404 Not FoundYour request409 ConflictCurrent state413 Payload Too LargeYour request422 UnprocessableYour request429 Too Many RequestsRate limit500 Server ErrorDaffy VoiceRate-limit errors
A 429 has its own body, with no detail:
{ "error": "rate_limited", "scope": "ip" }There is no Retry-After header. Back off for a few seconds and retry.
Retrying safely
Retry 429 and 5xx responses after a short wait. Don't retry other 4xx errors unchanged — fix the request first.
Creates aren't idempotent