Guides
Errors
Success responses use success: true with optional data and meta. Failures use success: false, a human message, and optional code / details.
Success envelope
{
"success": true,
"message": "Template send accepted",
"data": {
"to": "919876543210",
"templateId": "42",
"templateName": "new_user",
"status": "accepted"
}
}Error envelope
{
"success": false,
"message": "WhatsApp template is not APPROVED",
"code": "TEMPLATE_NOT_APPROVED"
}Common status codes
| Code | Meaning |
|---|---|
| 200 | OK - list returned, or a booking / service updated |
| 201 | Created - a new booking |
| 202 | Accepted - message queued for sending |
| 400 | Validation, WhatsApp not connected, template not approved, 24-hour window closed, or a booking status change that is not allowed |
| 401 | Missing, invalid or revoked API key / token, or an API key is required |
| 402 | The workspace's plan has expired (PLAN_EXPIRED) |
| 403 | JWT user is not the owner or a member of the workspace |
| 404 | Template, workspace, booking, service or staff member not found |
| 409 | Booking conflict - slot taken (SLOT_FULL) or customer at their limit (CUSTOMER_LIMIT) |
| 429 | Rate limit - more than 60 requests per minute for one API key |
| 500 | Queue unavailable or unexpected server error |
| 502 / 503 | Bookings are temporarily unavailable - retry shortly |
Machine codes
| code | When |
|---|---|
| VALIDATION_ERROR | Request body or query failed validation (see details) |
| API_KEY_INVALID | API key unknown or revoked |
| API_KEY_REQUIRED | Route needs a workspace API key; a Passport JWT is not accepted |
| RATE_LIMITED | More than 60 requests per minute for this API key |
| WA_NOT_CONNECTED | WhatsApp connection missing for workspace |
| WA_PHONE_INVALID | from does not match a WhatsApp number in the workspace |
| WA_PHONE_MISSING | No Meta phone number configured |
| WA_WINDOW_CLOSED | No customer message in the last 24 hours - use a template |
| MESSAGE_REQUIRED | type text without a message |
| MEDIA_URL_REQUIRED | type image / document without mediaUrl |
| TEMPLATE_NOT_FOUND | Template not found, or not in the API key's workspace |
| TEMPLATE_NOT_APPROVED | Template status is not APPROVED |
| TEMPLATE_PARAMS_INVALID | parameters do not match the template variables |
| INVALID_RECIPIENT | to is not a valid phone number |
| WORKSPACE_ACCESS_DENIED | JWT user is not the owner or a member of the workspace |
| WORKSPACE_NOT_FOUND | Workspace does not exist |
| QUEUE_UNAVAILABLE | Failed to enqueue send job |
| SLOT_FULL | Nothing is free at that time: taken, outside working hours, on leave, too soon, too far ahead, or the service is closed. Read availability again |
| CUSTOMER_LIMIT | This customer is already at their per-day or active-booking limit; details.existing is the booking in the way |
| BOOKING_NOT_FOUND | No such service, staff member, or booking with that external_ref |
| BOOKING_INVALID | Rejected by the booking rules, e.g. changing a cancelled booking |
| BOOKING_CONFLICT | Any other booking conflict |
| BOOKINGS_UNAVAILABLE | Bookings are temporarily unavailable (503) - retry |
| BOOKINGS_UPSTREAM_ERROR | Bookings failed on our side (502) - retry; contact support if it persists |
| PLAN_EXPIRED | The workspace's trial or paid plan has ended - renew it in the app |
| TOKEN_EXPIRED | Access token expired |
| TOKEN_REVOKED_OR_MISSING | Token revoked or missing in DB |
