Limits and Errors
Every crate has four limits, set by its plan. Errors come back as JSON with a message and, often, details.
The limits
| Limit | Free | Maker | When you go over |
|---|---|---|---|
| Requests a second (single readings and TTN) | 5 | 20 | 429 API rate limit exceeded |
| Batch requests a second | 1 | 5 | 429 API rate limit exceeded |
| Readings per batch | 100 | 250 | 400 Batch size limit exceeded |
| Readings a day | 50,000 | 5,000,000 | 429 Daily Quota Exceeded |
Rate limits count requests in one-second windows, for each sending address and crate. Every reply carries X-RateLimit-Limit and X-RateLimit-Remaining headers.
The daily limit counts readings, not requests, and resets at midnight UTC. If a crate used more than 80% of its limit, we email you the next day.
Errors
| Code | Message | What to do |
|---|---|---|
400 | Invalid request body | The body isn't valid JSON, or a batch isn't a JSON array. |
400 | Validation Error | device is missing, or a device or metric name is longer than 100 characters. |
400 | No valid data found | Nothing in the body is a number. |
400 | Batch size limit exceeded | Send smaller batches. details shows the limit and how many you sent. |
403 | API key is missing | Add the X-API-Key header. |
403 | Invalid API key for this crate | Check the key belongs to this crate, or that it hasn't been replaced. |
403 | Ingestion Method Mismatch | You sent plain readings to a The Things Network crate, or a webhook to a General crate. |
404 | Crate not found | Check the crate ID in the URL. |
429 | API rate limit exceeded | Slow down, then try again after a second. |
429 | Daily Quota Exceeded | Wait until midnight UTC, or move the crate to Maker. |
500 | Internal Server Error | Wait a moment and try again. |
Handling 429s
- Rate limit: wait a second and send again. If you get it often, send fewer, bigger batches.
- Daily limit: retrying won't help until the next day. Send less often, or move the crate to Maker.
For your own code, wait a little longer after each failed try (1 second, then 2, then 4) instead of retrying straight away.