Reference
Errors
HTTP status codes, common error codes, and the shape of a Bytloop error response.
Every error response from the Bytloop API shares the same shape, so a single handler can render or log any failure without special-casing the endpoint.
Response shape#
{
"error": {
"code": "recipient_suppressed",
"message": "customer@example.com is on the workspace suppression list.",
"correlation_id": "cor_2N9pKqRxLvZ8yT",
"details": {
"recipient": "customer@example.com",
"suppressed_at": "2026-03-02T09:14:07.001Z"
}
}
}code— a stable machine-readable identifier. Safe to switch on.message— human-readable, safe to show to a support agent but not to an end user (may reference internal details).correlation_id— the same id also logged on the Bytloop side. Copy it into any support request so we can find your request in seconds.details— optional, code-specific extra fields.
HTTP status codes#
| Status | Meaning | Retry? |
|---|---|---|
400 Bad Request | Malformed JSON or unknown fields. | No — fix the request. |
401 Unauthorized | Missing or malformed Authorization header. | No. |
403 Forbidden | The key is valid but not authorised for this action or workspace. | No. |
404 Not Found | The path or resource does not exist. | No. |
409 Conflict | Idempotency-Key collision with a different body. | No — pick a new key. |
422 Unprocessable Entity | Validation failed — see code for specifics. | Depends on the code. |
429 Too Many Requests | Rate or plan cap. See Rate limits. | Yes, after Retry-After. |
500 Internal Server Error | Something broke on our side. | Yes, with backoff. |
502 Bad Gateway, 503 Service Unavailable, 504 Gateway Timeout | Upstream provider hiccup. | Yes, with backoff. |
Common error codes#
| Code | Status | What it means |
|---|---|---|
invalid_request | 400 | The body could not be parsed as valid JSON. |
missing_field | 422 | A required field is absent. details.field names it. |
invalid_field | 422 | A field is present but the value is malformed. |
unauthenticated | 401 | The bearer token is missing, malformed, or revoked. |
insufficient_scope | 403 | The key does not have permission for this endpoint. |
domain_not_verified | 422 | The from domain has no verified record. |
recipient_suppressed | 422 | Recipient is on the workspace suppression list. |
attachment_too_large | 422 | Combined attachment size exceeds 15MB. |
rate_limited | 429 | Per-key or per-workspace throttle. |
plan_cap_reached | 429 | Monthly send cap exhausted for this billing period. |
idempotency_conflict | 409 | Same Idempotency-Key used with a different body. |
webhook_endpoint_disabled | 422 | The endpoint you tried to enqueue an event on is auto-disabled. |
internal_error | 500 | Unhandled server-side failure. Retry with backoff and include the correlation id if it persists. |
Handling errors well#
Three principles:
- Switch on
code, logmessage. Only the code is stable across releases; message wording can and will change. - Retry idempotently. Use
Idempotency-Keyon every mutating call.429and5xxare safe to retry; other statuses usually are not. - Surface
correlation_idon any user-visible failure. It is the single fastest way to get support unblocked.