Rate limiting
Each API key is subject to a limit of 100 requests per minute. The limit is counted using a 60-second sliding window, per key.Control headers
Every response includes headers that report the current state of your limit:| Header | Description |
|---|---|
X-RateLimit-Limit | Total limit for the current window |
X-RateLimit-Remaining | Requests remaining in the window |
X-RateLimit-Reset | Unix timestamp when the counter resets |
When the limit is reached
The API returns429 Too Many Requests with a Retry-After header indicating how many seconds to wait:
Implementing retry with backoff
Pagination
All listing routes support pagination via query params:| Parameter | Default | Maximum | Description |
|---|---|---|---|
page | 1 | — | Page number |
per_page | 20 | 100 | Items per page |
meta envelope with the total record count:
total_pages to know when to stop paginating. When page > total_pages, the data field returns an empty array.
Error codes
The API uses semantic HTTP statuses. All errors follow the same envelope format:Error table
| Status | When it occurs | What to do |
|---|---|---|
400 Bad Request | Invalid payload, missing required field, incorrect format | Read error.message — it specifies the problematic field |
401 Unauthorized | x-api-key header missing, key invalid, or revoked | Check the key under Settings → API Keys |
403 Forbidden | Valid key, but missing the required scope for the operation | Add the missing scope to the key or create a new one |
404 Not Found | Resource does not exist or does not belong to your workspace | Verify the ID and the active workspace |
409 Conflict | Resource already exists (e.g., channel with the same name, duplicate webhook) | Adjust the payload or update the existing resource |
429 Too Many Requests | Limit of 100 req/min reached | Use the Retry-After header to wait |
500 Internal Server Error | Unexpected error on the Timely.ai server | Try again. If it persists, open a ticket at contato@timelyai.com.br |
Internal error codes (error.code)
In addition to the HTTP status, the code field identifies the exact cause:
Authentication and authorization
Authentication and authorization
Resources not found
Resources not found
| Code | Description |
|---|---|
AGENT_NOT_FOUND | Agent does not exist in this workspace |
CONVERSATION_NOT_FOUND | Conversation not found |
CONTACT_NOT_FOUND | Contact not found |
CHANNEL_NOT_FOUND | Channel does not exist or is not active |
WEBHOOK_NOT_FOUND | Webhook endpoint not found |
Validation
Validation
| Code | Description |
|---|---|
VALIDATION_ERROR | One or more fields have an invalid format |
MISSING_REQUIRED_FIELD | Required field missing from the payload |
INVALID_PHONE_FORMAT | Phone number not in E.164 format |
PAYLOAD_TOO_LARGE | Request body exceeds the 5 MB limit |
Limits and conflicts
Limits and conflicts
| Code | Description |
|---|---|
RATE_LIMIT_EXCEEDED | 100 req/min reached |
DUPLICATE_WEBHOOK_URL | Webhook URL already registered in this workspace |
CHANNEL_ALREADY_CONNECTED | Channel already connected to another agent |
PLAN_LIMIT_REACHED | Agent or channel limit for the plan reached |
Next steps
Production checklist
Review everything before going live with real customers.
Webhooks
Receive real-time events without polling.