Rate limits
Rate limits #
To keep the service stable, these limits apply:
- 30 requests/minute on the endpoints that send (SMS, OTP, WhatsApp, Notify)
- 60 requests/minute on the read endpoints
- Limits are counted per organization (all your keys and IP addresses together) and per exact path. Past them, the API answers 429 with a Retry-After header.
Response headers tell you where you stand against your limits:
X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
Retrying without duplicates: Idempotency-Key
If a send request times out before the answer, you cannot tell whether the message left. Add an Idempotency-Key header, a unique value per send (a UUID for example), and send the same request again with the same key: it runs and is billed only once.
curl -u 'ak_xxx:sk_xxx' \
-X POST https://api.callistosignal.com/v1/sms/send \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 9b2f6c1e-4d7a-4f3b-8c55-2a1e0d9f7b31" \
-d '{"sender": "MYAPP", "to": ["+2250700000000"], "message": "Code: 4821"}'
- A retry with the same key and the same content (the order of the JSON fields does not matter) gets the first answer back, for 24 hours, with the Idempotent-Replayed: true header. It is the first call's answer: the balance it shows dates from that moment.
- The same key with another body answers 422 (idempotency_key_reused). A key whose first request is still running answers 409 (idempotency_key_in_progress): retry a few seconds later.
- Only a successful answer (2xx) is kept: after a refusal (validation, insufficient credit) nothing was sent or charged, and you can reuse the key once the problem is fixed.
- The key is 1 to 255 printable ASCII characters, with no space. It belongs to your organization. Without the header, the API behaves as before.