Errors and rate limits
The iChatUp API answers in JSON with ordinary HTTP status codes. A refusal carries a plain-language reason in an error field, and input that fails validation comes back as HTTP 422 with an errors object naming each field. Requests are rate-limited; when you receive HTTP 429, wait for the Retry-After header and try again.
要点一览
| Error shape | {"error": "…"} or {"message": "…", "errors": {…}} |
|---|---|
| Rate limiting | Yes; back off and retry on HTTP 429 |
| Retry safely with | The Idempotency-Key header |
Status codes
- 200 an existing contact was updated, or a read succeeded.
- 201 a new contact was created.
- 202 WhatsApp accepted a message; delivery comes later.
- 400 the Idempotency-Key header is longer than 255 characters.
- 401 missing or invalid key.
- 403 inactive account, or a promotional template on a plan without broadcasts.
- 404 no such message among those sent through the API.
- 409 the account has no official WhatsApp connection.
- 422 invalid input, an unknown template, a missing variable, or WhatsApp refused the send.
- 429 too many requests.
Reading an error
HTTP/1.1 422 Unprocessable Entity
{
"error": "variables is missing a value for {{2}}.",
"variables": ["1", "2"]
}Errors written by iChatUp use error and are safe to show to the person who set up the integration. Validation errors from the framework look like {"message": "The phone field is required.", "errors": {"phone": ["The phone field is required."]}}. Send Accept: application/json, or a validation failure may answer with a redirect instead of JSON.
Backing off
- On 429, read
Retry-After, wait that many seconds, then retry. - On 5xx or a timeout, retry with growing gaps, and send the same
Idempotency-Keyso the retry cannot send a second WhatsApp message. - Never retry a 4xx unchanged; fix the request the error describes.
See idempotency for how replays work.
常见问题
Is the rate limit published?
The limit may change, so build for it by backing off on HTTP 429 rather than relying on a fixed number.
Why did a message fail with 422 after validation passed?
WhatsApp itself refused it. The error field carries the reason, such as an opted-out customer or a broken connection.
在您自己的号码上试试
两分钟完成连接,免费试用 7 天,无需信用卡。AI 员工会在顾客已经熟悉的 WhatsApp 号码上回复、预订并跟进。