Response formats
Most Anant8-specific errors return { success: false, message: ... }. The Meta-shaped /v1 send routes use { error: { message, type, code } } for Anant8 validation, billing, and dispatch errors; provider 4xx bodies retain Meta's JSON shape. ASP.NET authentication challenges may return an empty response, and [ApiController] model validation may return ValidationProblemDetails. Do not assume every endpoint uses one common error envelope.
HTTP status codes
401 Unauthorized: missing, invalid, expired, or revoked Bearer credential; login also returns 401 for invalid credentials. 403 Forbidden: role, tenant, token phone/WABA scope, or developer-token route-scope check failed. 400 Bad Request: malformed/invalid request, invalid phone, invalid supplied Idempotency-Key, or invalid cursor. Idempotency-Key is optional. 404 Not Found: requested resource not found within the authenticated tenant. 409 Conflict: keyed payload mismatch, duplicate/in-progress operation, non-approved template, wrong template category, or duplicate contact. In-progress keyed sends include Retry-After guidance. 402 Payment Required: insufficient prepaid balance and no Meta request was made. 202 Accepted: Anant8-specific batch API queued work. The Meta-shaped /v1 send routes return 200 only after provider acceptance. 429: Meta provider rate limit; its JSON error is preserved and the reservation is released. 502: Meta returned a 5xx response or an invalid provider response; provider 5xx outcomes remain uncertain and are not resubmitted. 503: provider outcome is ambiguous; retry only with the same optional idempotency key and Anant8 will not resubmit.
Common response examples
Examples use response shapes returned by the current controllers.
// Invalid login (401)
{ "success": false, "message": "Invalid login credentials." }
// Invalid cursor (400)
{ "success": false, "message": "The history cursor is invalid." }
// Template is not approved (409)
{ "success": false, "message": "Only Meta-approved templates can be sent." }
// Contact phone already exists (409)
{ "success": false, "message": "A contact with this phone number already exists." }WhatsApp provider errors
Definitive Meta 4xx send errors retain the provider's JSON body and release the billing reservation; rate limits retain the 429 response. A Meta 5xx response is returned as HTTP 502 and is treated as uncertain. Network timeouts and other unconfirmed outcomes return HTTP 503. An uncertain operation holds its reservation for reconciliation and is never automatically resubmitted. A Meta-shaped HTTP 200 means provider acceptance only; later sent, delivered, read, or failed updates are recorded in message history. Anant8-specific batch routes continue to return HTTP 202 while queued.
Need help with an integration? Contact Anant8