Review Meta-compatible response shapes, validation rules, and error codes.
Meta-Compatible Responses and Errors
Summary
Review Meta-compatible response shapes, validation rules, and error codes.
Prerequisites
- A Whats91 account
- A generated public API token
Related documentation
Success Response
200 OK
{
"messaging_product": "whatsapp",
"contacts": [
{
"input": "918888888888",
"wa_id": "918888888888"
}
],
"messages": [
{
"id": "wamid.xxxxx"
}
],
"metadata": {
"apiVersion": "v2",
"requestId": "request-uuid"
}
}The response keeps the Meta-compatible messaging_product, contacts, and messages shape, with Whats91 metadata added for tracing.
Validation Rules
- Authorization: Bearer or JSON auth token fields are required.
- The request body must be JSON.
- to is required.
- type defaults to text when omitted.
- A supplied type requires its matching object.
- Number-scoped tokens can only use their assigned phoneNumberId.
Error Codes
| HTTP | Error code | Meaning |
|---|---|---|
| 401 | MISSING_BEARER_TOKEN | Missing public API token. |
| 401 | INVALID_PUBLIC_API_TOKEN | Invalid, expired, revoked, or inactive token. |
| 403 | SENDER_NOT_ALLOWED | Number-scoped token requested another sender. |
| 404 | PHONE_NUMBER_NOT_FOUND | Path phoneNumberId is not connected to the authenticated customer. |
| 400 | MISSING_TO | to is missing. |
| 400 | MISSING_TYPE_OBJECT | Payload type requires a matching object. |
| 400 | UNSUPPORTED_MESSAGE_TYPE | Unsupported Meta-compatible message type. |
| 415 | UNSUPPORTED_CONTENT_TYPE | Request is not JSON. |
Error response
{
"error": {
"message": "Missing required parameter: to",
"type": "Whats91PublicApiException",
"code": "MISSING_TO"
},
"metadata": {
"apiVersion": "v2",
"requestId": "request-uuid"
}
}Related Documentation
Messaging Meta-Compatibility
Understand the Meta-compatible JSON message sending endpoints exposed through Whats91.
Text
Send Meta-compatible text messages through the Whats91 public API.
Template
Send Meta-compatible template messages with language and components objects.
Media
Send Meta-compatible image, video, audio, document, and sticker message payloads.