# Errors and limits

> The error format and all error codes of the Sendtide API, the rate limit per key, quotas, attachment and batch limits, account status and reputation.

URL: https://sendtide.ch/en/docs/errors-and-limits/

Every error has the same shape and a stable code. This page shows how to read errors, which ones to retry and which limits apply.
## Error format

Errors answer with an HTTP status of 400 or above and this body:

```
{
  "error": {
    "code": "validation_error",
    "message": "to[0] is not a valid email address",
    "field": "to[0]"
  }
}
```
- code is stable and in snake_case. Program against the code, not against the text.
- message is for humans and in English. The wording can change.
- field points to the spot in the request where it fits. Nested fields are written like to[0], attachments[1].filename.

Every answer carries the header X-Request-Id. Give it to support when you need help. The [SDKs](https://sendtide.ch/en/docs/sdks/) return it as requestId in the error.
## Which errors to retry?
| Status | Retry? |
| --- | --- |
| 400, 401, 403, 404, 413, 415, 422 | No. The request is wrong, repeating it leads to the same result. Fix it. |
| 409 | Mostly no. Check the code: idempotency_conflict means you used the key with different content. |
| 429 | Yes, after Retry-After seconds. For quota_exceeded and budget_exceeded waiting does not help, only a higher plan or budget does. |
| 5xx | Yes, with growing gaps. Send the same Idempotency-Key, then no duplicate email is created. |

The SDKs retry network errors, 429 and 5xx themselves (default: two retries, with backoff and jitter), and POST s only when they carry an idempotency key.
## Rate limit

50 requests per second per key, with a burst up to 100. Above that the API answers 429 rate_limited with the header Retry-After. The limit protects against runaway clients, it is not your volume cap. For large volumes use the [batch](https://sendtide.ch/en/docs/sending-email/#batch) with up to 1,000 emails per request. SMTP has the same limit (451).
## Quotas
| | Free | Start | Business | Scale |
| --- | --- | --- | --- | --- |
| Emails per month | 3,000 | 50,000 | 150,000 | 1 million |
| At most per day | 100 | | | |
| Overage per 1,000 | not possible | CHF 0.80 | CHF 0.50 | CHF 0.30 |

Recipients are counted, not emails (To, Cc and Bcc that are actually sent to; suppressed addresses do not count). Test keys do not count. Above the quota you keep sending and pay the overage, or you stop sending at the quota (stop_at_quota) or set a monthly budget (budget_chf). Sending is then refused with 429 quota_exceeded or budget_exceeded. Alerts by email come at 80 and 100 percent of quota and budget.
## Other limits
| What | Limit |
| --- | --- |
| Size of an email (after MIME encoding) | 10 MB |
| Attachments per email | 20 |
| Emails per batch | 1,000 |
| Addresses per field (to, cc, bcc, reply_to) | 50 |
| Subject | 998 characters |
| Tags per email | 10 |
| Scheduled send (send_at) | 72 hours ahead |
| Idempotency key | 255 characters, lives 24 hours |
| Streams of your own | 10 |
| Restrictions per key (IP, domain) | 50 each |
| Search export by direct download | 100,000 emails (above that POST /v1/exports) |
| Exports at once | 5 |
| Webhook replay | 7 days, 50,000 events |
| Suppressions: CSV import | 16 MB, 100,000 rows |
| Suppressions: allow again at once | 10,000 addresses |
## Account status and reputation

An account has a status (GET /v1/account):
- review: newly created. Live keys send once the owner has verified the email address (403 account_in_review). Test keys work.
- active: normal.
- paused: sending is halted (403 account_paused). paused_reason gives the reason: payment (unpaid invoice), bounce_rate, complaint_rate or deleting. Queued mail waits until the account is active again.

Sendtide evaluates reputation per account over the last 7 days, from 200 live emails on. From 2 percent bounces or 0.05 percent complaints a warning goes to owners and admins. From 4 percent or 0.08 percent the account pauses automatically so that the mail provider does not block you. You see the values in reputation of GET /v1/account. Keep your lists clean, remove bounces and send only to addresses that agreed.
## Retention

Sendtide deletes the content of emails (HTML, text, raw message, headers) after the content days of the plan: 7 on Free and Start, 30 on Business, 90 on Scale. Emails, events, deliveries and logs stay for the metadata days: 30, 30, 90 and 90. On Scale, emails then move to an archive for 2 years. You can shorten both periods in the account settings (retention_content_days, retention_metadata_days), never lengthen them. More under [Retention and deletion](https://sendtide.ch/en/docs/retention-and-deletion/).
## All error codes

Status and code come from the OpenAPI specification and the list of errors that concern keys. The code is always in error.code.
| Status | Code | Meaning |
| --- | --- | --- |
| 400 | invalid_idempotency_key | The Idempotency-Key is longer than 255 characters. |
| 400 | invalid_json | The body is not valid JSON for this endpoint or has an unknown field. field names the spot. |
| 400 | unsupported_version | The Sendtide-Version header names an unknown version. |
| 401 | invalid_api_key | The key is not valid or was revoked. |
| 401 | missing_api_key | Authorization: Bearer sk_… is missing. |
| 402 | payment_method_required | The account needs TWINT or a card before this change. |
| 403 | account_in_review | The account is in review: live keys send once the owner has verified the email address. Test keys work. |
| 403 | account_paused | Sending is paused (payment, bounce or complaint rate, deletion). GET /v1/account gives the reason in paused_reason. |
| 403 | api_key_required | The CLI listener needs an API key, a dashboard session cannot listen. |
| 403 | billed_by_main_account | A sub-account is billed and deleted through its main account. |
| 403 | broadcast_not_available | See the description of the endpoint in the API reference. |
| 403 | broadcast_not_enabled | The broadcast stream is not enabled for this account and is not offered in the first release. Send through transactional. |
| 403 | dashboard_only | The endpoint belongs to the dashboard and is not available with a key. |
| 403 | domain_not_allowed | The key may not send from this domain (allowed_domains). |
| 403 | env_not_allowed | A key can only create, rotate or revoke keys of its own environment (test or live). |
| 403 | insufficient_scope | The key scope is not enough, or a key tries to create a key with more rights. |
| 403 | ip_not_allowed | The key may not be used from this IP address (allowed_ips). |
| 403 | not_allowed | A sub-account cannot have sub-accounts. |
| 403 | plan_limit | The feature belongs to a higher plan (sub-accounts, SSO, archive, own IP pool). |
| 403 | restriction_not_allowed | A new or rotated key may not be less restricted than the key that creates it: its IP, domain and stream lists may not be wider. |
| 403 | stream_not_allowed | The key may not send through this stream (allowed_streams). |
| 403 | template_locked | The main account does not allow adapting this template. |
| 403 | test_key_forbidden | A test key sends test mail and reads, but changes nothing that live sending depends on (templates, webhooks, domains, streams, routes, suppressions, team, billing, account). Use a live key or the dashboard. |
| 404 | not_found | The resource does not exist, or not in this account and environment (test or live). |
| 404 | posthog_not_configured | PostHog is not set up for this account. |
| 404 | version_not_found | The template has no such version. |
| 409 | alias_taken | A template with this alias exists. |
| 409 | delivery_pending | The webhook delivery is still being sent or waits for its next attempt. |
| 409 | domain_exists | The domain is already added to an account. |
| 409 | idempotency_conflict | The Idempotency-Key was already used with a different request. |
| 409 | not_cancelable | The mail is no longer queued and cannot be canceled. |
| 409 | not_reschedulable | The mail is no longer queued and cannot be moved. |
| 409 | sso_domain_taken | Another account has already verified this email domain for SSO. |
| 409 | stream_exists | A stream with this slug exists. |
| 409 | stream_in_use | Mail of this stream is still waiting to be sent. |
| 409 | suppression_locked | The recipient complained about your mail, a complaint cannot be removed from the suppression list. |
| 409 | tracking_domain_exists | The tracking domain is already in use. |
| 409 | webhook_disabled | The webhook is disabled, enable it first. |
| 410 | listener_expired | The CLI listener expired after 5 minutes without a poll. Start it again with POST /v1/webhooks/listen. |
| 413 | request_too_large | The request is larger than allowed (mail 10 MB). |
| 415 | unsupported_media_type | Send the CSV as text/csv or as multipart/form-data with a file field. |
| 422 | business_details_required | Outside Switzerland and Liechtenstein Sendtide sells to businesses only: paid plans and the IP pool need a company, a country and a valid VAT number in the billing address. |
| 422 | domain_not_verified | The sender domain is not verified in this account (live keys). |
| 422 | domain_reserved | The domain name is reserved (sendtide.ch and subdomains). |
| 422 | feature_unavailable | The feature is not switched on for the platform yet. |
| 422 | invalid_host | The PostHog host is not an allowed one (https://eu.i.posthog.com, https://us.i.posthog.com) or a valid https URL of a self-hosted PostHog. |
| 422 | invalid_posthog_key | The project API key starts with phc_ (Project settings in PostHog). Personal keys (phx_) do not work. |
| 422 | language_not_available | The template has no version for this locale and no fallback. |
| 422 | missing_variables | The template needs values that data lacks. The message names them. |
| 422 | range_too_large | More than 100,000 mails in the range: use POST /v1/exports. |
| 422 | sso_discovery_failed | The /.well-known/openid-configuration of the SSO issuer could not be read. |
| 422 | stream_builtin | transactional and broadcast cannot be deleted. |
| 422 | stream_limit | An account has at most 10 streams of its own. |
| 422 | stream_not_found | No stream with this slug, see /v1/streams. |
| 422 | template_error | The template cannot be rendered, for example because of a syntax error. |
| 422 | template_not_found | No template with this alias or id. |
| 422 | template_not_published | The template has no published version yet. |
| 422 | tenant_not_found | No sub-account with this slug. |
| 422 | too_many_events | More than 50,000 events in the replay range. |
| 422 | too_many_rows | A CSV has at most 100,000 rows, split the file. |
| 422 | unsubscribe_required | Broadcast streams require List-Unsubscribe, set unsubscribe. |
| 422 | validation_error | A value is not valid. field points to the spot, such as to[0]. |
| 429 | budget_exceeded | Overage would exceed the monthly budget (budget_chf). |
| 429 | quota_exceeded | The daily or monthly quota of the plan is used up, or the account stops at the quota. |
| 429 | rate_limited | More than 50 requests per second with this key. Retry-After gives the wait. |
| 429 | suppression_removal_limit | See the description of the endpoint in the API reference. |
| 429 | too_many_exports | At most 5 exports at a time. |
| 500 | internal_error | An error on our side. Repeat the request with the same Idempotency-Key. |
| 502 | dns_error | The DNS lookup failed, try again in a moment. |
