The Error Object
When an API request fails, the response body contains anerror object with the following structure:
Error response
Attributes
| Attribute | Type | Always present | Description |
|---|---|---|---|
type | string | Yes | The category of error. One of invalid_request_error, authentication_error, provider_error, or api_error. |
message | string | Yes | A human-readable description of the error. Safe to display to end users. |
code | string | No | A machine-readable error code for programmatic handling. Only present for errors that benefit from branching logic. See Error Codes. |
doc_url | string | No | A URL to the documentation page for this specific error code. |
param | string | No | The request parameter that caused the error (e.g., "from", "to[0]"). Present for validation errors. |
provider | object | No | Upstream provider error details. Only present when the error originates from Meta or Telnyx. |
provider.source | string | — | The provider that returned the error: "meta" or "telnyx". |
provider.code | number or string | — | The provider’s native error code. |
provider.message | string | — | The provider’s error message. |
provider.fbtrace_id | string | — | Meta’s trace ID. Include this when contacting Meta support. |
Error Types
Every error has atype that tells you the category of the problem. The HTTP status code tells you the status; the type tells you what kind of problem occurred.
| Type | Description | Typical HTTP Codes |
|---|---|---|
invalid_request_error | The request has invalid parameters, missing fields, or bad formatting. | 400, 404, 409 |
authentication_error | The API key is missing, invalid, or does not have the required permissions. | 401, 403 |
provider_error | Meta or Telnyx returned an error. The request was valid, but the operation failed at the provider level. | 402, 424 |
api_error | Something went wrong on Chirp’s end. These are rare and typically transient. | 500, 502, 503 |
invalid_request_error
Returned when the request itself is malformed or references something that does not exist. Check theparam field to identify which parameter caused the issue.
Validation error
Invalid phone number
authentication_error
Returned when there is a problem with the API key. Nocode is needed because the type and HTTP status are sufficient.
Authentication error
provider_error
Returned when the request was valid but the operation failed at Meta or Telnyx. Theprovider object contains the raw error from the upstream API. This is the most common error type when sending messages.
Provider error
api_error
Returned when something goes wrong on Chirp’s end. These errors are rare and typically resolve on their own. Safe to retry with exponential backoff.API error
HTTP Status Codes
The Chirp API uses specific HTTP status codes to indicate the nature of the error:| Code | Name | Description |
|---|---|---|
| 200 | OK | The request succeeded. |
| 201 | Created | A new resource was created. |
| 400 | Bad Request | Invalid parameters, missing fields, or bad formatting. |
| 401 | Unauthorized | No valid API key was provided. |
| 402 | Request Failed | The request was valid, but the operation failed (e.g., message could not be delivered). |
| 403 | Forbidden | The API key does not have the required permissions. |
| 404 | Not Found | The requested resource does not exist. |
| 409 | Conflict | The request conflicts with the current state (e.g., duplicate resource). |
| 424 | Failed Dependency | An external provider (Meta or Telnyx) is unavailable or returned an unrecoverable error. |
| 429 | Too Many Requests | Rate limit exceeded. See Rate Limits. |
| 500 | Server Error | Something went wrong on Chirp’s end. |
402 vs 400: A
400 means your request was malformed. A 402 means your request was valid, but the operation failed downstream (e.g., the message could not be delivered). This distinction helps you separate input errors from delivery failures.424 vs 500: A
424 means an external provider (Meta or Telnyx) failed. A 500 means Chirp’s own systems had an issue. This tells you whether the problem is on Chirp’s side or the provider’s side.Provider Errors
When errors originate from Meta (WhatsApp) or Telnyx (SMS/MMS), theprovider object contains the raw error details from the upstream API. Chirp maps these provider errors to standardized Chirp error codes so you can handle them consistently.
The provider object is useful for:
- Debugging — The provider’s native error code and message give you additional context.
- Meta support tickets — Include the
fbtrace_idwhen contacting Meta support about WhatsApp issues. - Detailed logging — Log the full provider object for your operations team.
- WhatsApp Error Codes for Meta error code mappings
- SMS Error Codes for Telnyx error code mappings