# Limits and retries

https://docs.sendsms.to/en/guides/retries/

How to repeat requests without duplicate SMS: Idempotency-Key, the 409, 429 and 503 answers and the rate limits.

## Idempotency-Key

One key — one logical send. Generate a UUID before the first request and keep it with the order or event. The key is scoped to your account.

| Repeat | Answer |
| --- | --- |
| same key, same body | 202 with the same messageId and duplicate: true; no second SMS |
| same key, another body | 409 idempotency_conflict (scenario events: 422 idempotency_key_reused) |
| the first request with this key is still being processed | 409 idempotency_in_progress, retryable: true, Retry-After — repeat later with the same key and body |

In a batch [POST /v1/messages/batch](https://docs.sendsms.to/en/api/batch-send/) every item has its own `idempotencyKey`.

## A timeout is not a refusal

If no answer came (a dropped connection, a timeout) the request may have been accepted. Do not send with a new key: repeat with the same `Idempotency-Key` or check the known `messageId`.

## Rate limits

- The general limit is a number of requests per second per account; above it, 429.
- Balance [GET /v1/balance](https://docs.sendsms.to/en/api/balance/): at most one request per 10 seconds per account — 429 `balance_rate_limit` with `Retry-After: 10`.
- A batch takes up to 25 messages; a status reconciliation up to 100 identifiers per request.

## When to repeat

| Answer | Repeat |
| --- | --- |
| 429, 503 | yes — after a pause (Retry-After when present), the same request |
| 409 with retryable: true | yes — later, with the same key and body |
| 400, 401, 403, 404, 422 | no — fix the request, the key or the settings |
| 402 | after topping up — with a new key |
