> ## Documentation Index
> Fetch the complete documentation index at: https://hellotars.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# API errors

> Handle shared problem responses using stable codes, retry guidance and a request ID for support.

Failures use application/problem+json with the same shape across API resources.

## Problem object

| Field | Meaning |
| - | - |
| title | Human-readable summary |
| status | HTTP status code |
| detail | Explanation for this request |
| instance | req\_ request ID for logs and support |
| code | Stable machine-readable code |
| retryable | Whether retrying can succeed |

Some codes add extensions such as required, region, errors, field, contactId, callId or reason.

Validation errors contain entries with path, code and optional message. Branch on code rather than matching title or detail text.

## Campaign send field errors

A campaign send or validate call that fails with validation\_failed lists each wrong field in errors. The path names the field and the code names the problem.

| Path | Code | Meaning and fix |
| - | - | - |
| usecase | required | The campaign sends usecases and the call has none. Add `usecase`. |
| usecase | unknown\_usecase | The campaign has no usecase with this name. Check the name. |
| usecase | not\_allowed | The campaign sends one template and takes no usecase. Remove `usecase`. |
| template | unsupported\_template | The usecase's template cannot be sent through the API. Pick another template for the usecase. |
| params, media | not\_allowed | A usecase fills these from `data`. Remove them. |
| data.KEY | data\_field\_missing | The usecase needs this key and has no fallback. Add it to `data`. |
| data.KEY | data\_field\_invalid | The value cannot fill the template. The message gives the reason. Fix the value. |
| data.KEY | invalid\_media | The key must hold an `https://` link to a file that WhatsApp accepts. |

Replace KEY with the key name. A value must be text, a number, or true or false. The reason in the message can say that the value has a line break, a tab, five or more spaces in a row, or too many characters. For a link, it can say that the value has characters that cannot go in a link.

Do not retry a validation\_failed response with the same body. Fix the fields first.

## Usecase and template codes

These codes apply to a campaign that sends usecases. Retry only the ones marked retryable, and honor the Retry-After header.

| Code | Cause | What to do |
| - | - | - |
| usecase\_paused | A person turned the usecase off. | Retry later. |
| template\_paused | WhatsApp paused the template or is reviewing it again. | Retry later. |
| usecase\_gone | The usecase was retired. | Stop sending it. |
| template\_not\_approved | The template was rejected, disabled, deleted, or failed to submit. | Ask a person to switch the usecase to another template. |
| template\_version\_drift | The template changed after the usecase was saved. | Ask a person to re-save the usecase. |

When several problems apply, the response names the first in this order: campaign paused, wrong usecase field, retired usecase, usecase turned off, template state, then data fields. A malformed recipient number comes first on a paused campaign, and after the usecase checks on an active one.

## Codes

| Code | Status | Title | Retryable | Extensions |
| - | - | - | - | - |
| invalid\_json | 400 | Request body is not valid JSON | false | None |
| validation\_failed | 400 | Request failed validation | false | errors |
| variable\_key\_not\_allowed | 400 | A variable is not allowed | false | errors |
| invalid\_variable\_value | 400 | A variable value is not valid | false | errors |
| cursor\_expired | 400 | The cursor has expired | false | None |
| cursor\_mismatch | 400 | The cursor belongs to another request | false | None |
| campaign\_mode\_invalid | 400 | Campaign is not in webhook mode | false | None |
| unauthorized | 401 | Missing or invalid authorization | false | None |
| invalid\_key | 401 | Invalid or revoked API key | false | None |
| session\_invalid | 401 | The voice widget session is invalid | false | None |
| insufficient\_balance | 402 | Insufficient credit balance | false | None |
| organization\_inactive | 403 | Organization is inactive | false | None |
| billing\_locked | 403 | A paid plan is required | false | None |
| permission\_missing | 403 | The API key lacks the permission this endpoint requires | false | required |
| resource\_not\_allowed | 403 | The API key cannot reach this resource | false | None |
| entitlement\_missing | 403 | Voice is unavailable for this organization | false | callId, reason |
| origin\_not\_allowed | 403 | This site may not start calls | false | None |
| recaptcha\_failed | 403 | reCAPTCHA verification failed | false | None |
| consent\_revoked | 403 | Recipient has opted out | false | None |
| us\_marketing\_blocked | 403 | US marketing message blocked | false | None |
| channel\_test\_mode | 403 | Channel is in test mode | false | None |
| quota\_exceeded | 403 | A plan limit has been reached | false | None |
| forbidden | 403 | The request is not allowed | false | None |
| not\_found | 404 | Not found | false | None |
| method\_not\_allowed | 405 | Method not allowed | false | None |
| wrong\_region | 409 | The organization lives in another region | false | region |
| conflict | 409 | The resource changed since you read it | false | None |
| contact\_exists | 409 | A contact with this email or phone already exists | false | field, contactId |
| idempotency\_key\_reuse | 409 | Idempotency key was used for another request | false | None |
| agent\_unavailable | 409 | The agent is not available | false | callId, reason |
| call\_not\_live | 409 | The call is not live | false | None |
| call\_still\_live | 409 | The call is still live | false | None |
| call\_content\_deleted | 409 | The call content has been deleted | false | None |
| invalid\_state | 409 | The resource does not allow this change now | false | callId, reason |
| campaign\_paused | 409 | Campaign is not active | true | None |
| template\_version\_drift | 409 | Template version drift | false | None |
| usecase\_paused | 409 | Usecase is not active | true | None |
| template\_paused | 409 | Template is not active | true | None |
| channel\_unavailable | 409 | Channel account is unavailable | true | None |
| artefact\_deleted | 410 | The artefact has been deleted | false | None |
| campaign\_gone | 410 | Campaign has ended | false | None |
| usecase\_gone | 410 | Usecase has ended | false | None |
| payload\_too\_large | 413 | Request body is too large | false | None |
| template\_not\_approved | 422 | Template is not approved | false | None |
| channel\_misconfigured | 422 | Channel is misconfigured | false | None |
| channel\_reauth\_required | 422 | WhatsApp connection expired : reconnect the account | false | None |
| meta\_rejected | 422 | Message rejected by WhatsApp | false | None |
| rate\_limited | 429 | Rate limit exceeded | true | callId, reason |
| concurrency\_limit\_reached | 429 | No call slot is free | true | callId, reason |
| worker\_busy | 429 | All agents are busy right now | true | callId, reason |
| meta\_rate\_limited | 429 | WhatsApp is rate limiting sends | true | None |
| internal\_error | 500 | Internal error | false | None |
| upstream\_unavailable | 503 | A provider Tars depends on is unavailable | true | None |
| meta\_unavailable | 503 | WhatsApp is temporarily unavailable | true | None |
| worker\_not\_deployed | 503 | No voice worker serves this deployment | false | callId, reason |
| worker\_unavailable | 503 | No voice worker is available right now | true | callId, reason |

## Retrying

Retry only when retryable is true. Every retryable problem carries Retry-After in seconds. Wait at least that long before trying again.

For call creation, preserve Idempotency-Key when retrying the same request. See [Requests](https://hellotars.com/docs/developer/requests.md).

## Request IDs

Keep instance with your logs. Include it when asking support about a failure. Do not log API keys or secret request headers.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.