{
    "variable": [
        {
            "id": "baseUrl",
            "key": "baseUrl",
            "type": "string",
            "name": "string",
            "value": "https:\/\/wagateway.io"
        }
    ],
    "info": {
        "name": "WA Gateway API Documentation",
        "_postman_id": "6fbd4f0f-14b0-4a42-8139-aef424f7fb11",
        "description": "Send and receive WhatsApp messages through your own connected number.",
        "schema": "https:\/\/schema.getpostman.com\/json\/collection\/v2.1.0\/collection.json"
    },
    "item": [
        {
            "name": "Instances",
            "description": "\nAn instance is one WhatsApp number connected to your account. Create it, pair it by\nscanning the QR code, then use its token for everything else.",
            "item": [
                {
                    "name": "Create an instance",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"name\":\"Sales line\"}"
                        },
                        "description": "Creates a new WhatsApp number slot and starts pairing. **Authenticate with your account\ntoken (`wat_\u2026`)**, not an instance token. The response contains the instance token\n(`wai_\u2026`) **once**: store it, it cannot be shown again. Next, poll the QR endpoint."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\"success\":true,\"data\":{\"instance\":{\"id\":\"01j9z8k2m3n4p5q6r7s8t9v0wx\",\"name\":\"Sales line\",\"status\":\"pending\",\"phone\":null,\"webhook_url\":null,\"webhook_events\":[\"message.received\",\"message.status\"],\"connected_at\":null,\"last_seen_at\":null,\"created_at\":\"2026-10-12T10:00:00Z\"},\"token\":\"wai_3f9c1e2b7a6d4c8e9f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c\",\"token_notice\":\"Store this token now; it cannot be shown again.\"},\"error\":null}",
                            "name": "Created"
                        },
                        {
                            "header": [],
                            "code": 401,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"unauthorized\",\"message\":\"Missing or invalid account token.\"}}",
                            "name": "Missing or wrong account token"
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"plan_limit_reached\",\"message\":\"Your plan allows 3 numbers. Delete one or upgrade your plan.\"}}",
                            "name": "Plan limit reached"
                        },
                        {
                            "header": [],
                            "code": 403,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"account_inactive\",\"message\":\"Account is suspended or the subscription has expired.\"}}",
                            "name": "Account suspended or expired"
                        }
                    ]
                },
                {
                    "name": "Get the pairing QR code",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances\/:id\/qr",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances\/:id\/qr",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8k2m3n4p5q6r7s8t9v0wx",
                                    "description": "The instance ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Returns the current QR code as a PNG data URL, ready for an `<img src>`. Poll every\n2\u20133 seconds: the QR rotates about every 20 seconds and `qr` is `null` while a new one\nis being generated. Scan it with WhatsApp on the phone (Settings \u2192 Linked devices \u2192\nLink a device). When `status` becomes `connected`, pairing is done and `qr` stays `null`."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"qr\":\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAAB...\",\"status\":\"qr\"},\"error\":null}",
                            "name": "Waiting for scan"
                        },
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"qr\":null,\"status\":\"connected\"},\"error\":null}",
                            "name": "Paired"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"not_found\",\"message\":\"Resource not found.\"}}",
                            "name": "Not your instance"
                        }
                    ]
                },
                {
                    "name": "Get instance status",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances\/:id\/status",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances\/:id\/status",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8k2m3n4p5q6r7s8t9v0wx",
                                    "description": "The instance ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "`status` is one of: `pending` (created, not paired), `qr` (waiting for scan),\n`connected`, `disconnected` (temporarily offline, reconnecting automatically),\n`logged_out` (unlinked from the phone; pair again), `banned` (blocked by WhatsApp),\n`paused` (sending stopped after repeated failures; contact support).\n\n`quota` is today's sending allowance for this number (UTC day): `daily_limit` is the\nplan limit, lowered during the first 7 days after pairing (`warmup`); `remaining` counts\ndown as messages are sent and resets at `resets_at`. Messages over the limit stay\nqueued until then. `quota` is `null` if it cannot be read right now.\n\n`restrictions` shows WhatsApp's own limits on starting new chats: `timelock` (`active`,\n`until`, `type`) and `new_chat_cap` (`status`: `NONE`, `FIRST_WARNING`, `SECOND_WARNING`\nor `CAPPED`; `used`, `total`, `resets_at`), checked at `checked_at`. While one applies,\nmessages to new contacts are refused with `423` (see Messages); existing chats work."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8k2m3n4p5q6r7s8t9v0wx\",\"name\":\"Sales line\",\"status\":\"connected\",\"phone\":\"201001234567\",\"webhook_url\":\"https:\/\/example.com\/wa-webhook\",\"webhook_events\":[\"message.received\",\"message.status\"],\"auto_read\":false,\"connected_at\":\"2026-10-12T10:02:11Z\",\"last_seen_at\":\"2026-10-12T14:30:00Z\",\"restrictions\":{\"timelock\":{\"active\":false,\"until\":null,\"type\":null},\"new_chat_cap\":null,\"checked_at\":\"2026-10-12T14:00:00Z\"},\"created_at\":\"2026-10-12T10:00:00Z\",\"quota\":{\"daily_limit\":200,\"plan_limit\":1000,\"warmup\":true,\"sent_today\":37,\"remaining\":163,\"resets_at\":\"2026-10-13T00:00:00.000Z\"}},\"error\":null}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Log out (unlink the number)",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances\/:id\/logout",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances\/:id\/logout",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8k2m3n4p5q6r7s8t9v0wx",
                                    "description": "The instance ID."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Unlinks this instance from the WhatsApp account, like removing it under Linked devices\non the phone. Queued messages are not sent. To use the number again, pair it with a new QR."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8k2m3n4p5q6r7s8t9v0wx\",\"name\":\"Sales line\",\"status\":\"logged_out\",\"phone\":\"201001234567\",\"webhook_url\":null,\"webhook_events\":[\"message.received\",\"message.status\"],\"connected_at\":null,\"last_seen_at\":\"2026-10-12T14:31:00Z\",\"created_at\":\"2026-10-12T10:00:00Z\"},\"error\":null}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The WhatsApp service is temporarily unavailable. Please retry.\"}}",
                            "name": "Service temporarily unavailable"
                        }
                    ]
                },
                {
                    "name": "Update instance settings",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances\/:id\/settings",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances\/:id\/settings",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8k2m3n4p5q6r7s8t9v0wx",
                                    "description": "The instance ID."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"auto_read\":true}"
                        },
                        "description": "`auto_read`: mark every new incoming message as read (blue ticks for the sender) a few\nseconds after it arrives, like a person opening the chat. Off by default; you can also\nmark single messages with \"Mark a message as read\"."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8k2m3n4p5q6r7s8t9v0wx\",\"name\":\"Sales line\",\"status\":\"connected\",\"auto_read\":true},\"error\":null}",
                            "name": ""
                        }
                    ]
                }
            ]
        },
        {
            "name": "Messages",
            "description": "\n**Safe retries:** send an `Idempotency-Key` header (any unique string up to 255 printable\ncharacters, e.g. `order-1042-shipped`). If you retry with the same key, you get the original\nmessage back (`202`, header `Idempotent-Replayed: true`) and nothing is sent twice. The same\nkey with a different request returns `422 idempotency_key_reused`; while the first request\nwith that key is still being processed, a repeat gets `409 idempotency_conflict` (retry\nshortly). Keys are per number.\n\nSending is asynchronous: a send endpoint validates and queues the message, then answers\n`202 Accepted` with its `message_id`. The message then moves `queued` \u2192 `sent` \u2192\n`delivered` \u2192 `read` (or `failed`), reported on your webhook as `message.status` and\nvisible with \"Get a message\". Media is downloaded by us from the `url` you give (public\nhttp\/https only, max 16 MB).\n\n**WhatsApp restrictions:** WhatsApp may temporarily stop a number from starting NEW chats\n(a \"timelock\"), or cap how many new chats it can start per period. While that applies, a\nmessage to someone the number has no chat with yet is refused with `423`\n(`account_restricted` or `new_chat_limit_reached`, with `data.until`); trying anyway would\nmake the restriction worse. Existing chats keep working, and so do messages scheduled\n(`send_at`) after `until`. See `restrictions` in \"Get instance status\" and the\n`instance.restriction` webhook.\n\n**Replies:** add `reply_to` with the `message_id` of a message in the same chat (one you\nreceived, or sent) and WhatsApp shows it quoted above yours, like swiping to reply.",
            "item": [
                {
                    "name": "Send a text message",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/text",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/text"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "order-1042-shipped"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"text\":\"Hi Ahmed, your order #1042 has shipped.\\nTrack it: https:\\\/\\\/example.com\\\/t\\\/1042\"}"
                        },
                        "description": "Plain text, up to 65,536 characters. Whitespace and line breaks are kept as sent."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is qr; connect it by scanning the QR code first.\"}}",
                            "name": "Number not paired"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\",\"fields\":{\"to\":[\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\"]}}}",
                            "name": "Invalid input"
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\"},\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The message could not be queued right now. Please retry.\"}}",
                            "name": "Could not queue (retry)"
                        }
                    ]
                },
                {
                    "name": "Send an image",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/image",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/image"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "order-1042-shipped"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"url\":\"https:\\\/\\\/cdn.example.com\\\/products\\\/1042.jpg\",\"caption\":\"Your order is on its way\"}"
                        },
                        "description": "JPEG, PNG or WebP from a public URL, with an optional caption (max 1,024 characters)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is qr; connect it by scanning the QR code first.\"}}",
                            "name": "Number not paired"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\",\"fields\":{\"to\":[\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\"]}}}",
                            "name": "Invalid input"
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\"},\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The message could not be queued right now. Please retry.\"}}",
                            "name": "Could not queue (retry)"
                        }
                    ]
                },
                {
                    "name": "Send a video",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/video",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/video"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "order-1042-shipped"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"url\":\"https:\\\/\\\/cdn.example.com\\\/videos\\\/unboxing.mp4\",\"caption\":\"How to set it up\"}"
                        },
                        "description": "MP4 (H.264\/AAC) from a public URL, with an optional caption. Max 16 MB."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is qr; connect it by scanning the QR code first.\"}}",
                            "name": "Number not paired"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\",\"fields\":{\"to\":[\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\"]}}}",
                            "name": "Invalid input"
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\"},\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The message could not be queued right now. Please retry.\"}}",
                            "name": "Could not queue (retry)"
                        }
                    ]
                },
                {
                    "name": "Send audio or a voice note",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/audio",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/audio"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "order-1042-shipped"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"url\":\"https:\\\/\\\/cdn.example.com\\\/audio\\\/welcome.ogg\",\"voice_note\":true}"
                        },
                        "description": "As an audio file (default), or as a voice note with `voice_note: true`. Voice notes\nmust be OGG\/Opus to play inline in WhatsApp; MP3 works for audio files."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is qr; connect it by scanning the QR code first.\"}}",
                            "name": "Number not paired"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\",\"fields\":{\"to\":[\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\"]}}}",
                            "name": "Invalid input"
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\"},\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The message could not be queued right now. Please retry.\"}}",
                            "name": "Could not queue (retry)"
                        }
                    ]
                },
                {
                    "name": "Send a document",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/document",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/document"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "order-1042-shipped"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"url\":\"https:\\\/\\\/cdn.example.com\\\/invoices\\\/1042.pdf\",\"filename\":\"Invoice-1042.pdf\",\"mimetype\":\"application\\\/pdf\",\"caption\":\"Your invoice for October\"}"
                        },
                        "description": "Any file (PDF, DOCX, XLSX, ZIP, \u2026) from a public URL. `filename` is what the recipient\nsees; `mimetype` must match the file."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is qr; connect it by scanning the QR code first.\"}}",
                            "name": "Number not paired"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\",\"fields\":{\"to\":[\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\"]}}}",
                            "name": "Invalid input"
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\"},\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The message could not be queued right now. Please retry.\"}}",
                            "name": "Could not queue (retry)"
                        }
                    ]
                },
                {
                    "name": "Send a location",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/location",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/location"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "order-1042-shipped"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"lat\":30.0444,\"lng\":31.2357,\"name\":\"Cairo Store\",\"address\":\"12 Tahrir Square, Cairo\"}"
                        },
                        "description": "A map pin with optional name and address."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is qr; connect it by scanning the QR code first.\"}}",
                            "name": "Number not paired"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\",\"fields\":{\"to\":[\"The recipient phone (to) must be an international phone number, e.g. +201001234567.\"]}}}",
                            "name": "Invalid input"
                        },
                        {
                            "header": [],
                            "code": 503,
                            "body": "{\"success\":false,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\"},\"error\":{\"code\":\"engine_unavailable\",\"message\":\"The message could not be queued right now. Please retry.\"}}",
                            "name": "Could not queue (retry)"
                        }
                    ]
                },
                {
                    "name": "Send a poll",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/poll",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/poll"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Idempotency-Key",
                                "value": "restock-poll-2026-11"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"question\":\"Which scent should we restock first?\",\"options\":[\"b\"],\"multiple\":false}"
                        },
                        "description": "A question with 2\u201312 answers, one choice or several (`multiple`). Votes come back on\nyour webhook as `message.poll_vote` (the voter's current choice; an empty `selected`\nmeans they removed their vote), and the totals are in \"Get a message\"\n(`content.votes`: one `{from, selected, at}` per voter)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 202,
                            "body": "{\"success\":true,\"data\":{\"message_id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"queued\"},\"error\":null}",
                            "name": "Queued"
                        }
                    ]
                },
                {
                    "name": "List messages",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages",
                            "query": [
                                {
                                    "key": "status",
                                    "value": "failed",
                                    "description": "Only messages with this status: queued, sent, delivered, read, failed, received.",
                                    "disabled": false
                                },
                                {
                                    "key": "direction",
                                    "value": "out",
                                    "description": "`out` for sent, `in` for received.",
                                    "disabled": false
                                },
                                {
                                    "key": "from",
                                    "value": "2026-10-01",
                                    "description": "Created at or after this date\/time (UTC, ISO 8601 or YYYY-MM-DD). Must be a valid date.",
                                    "disabled": false
                                },
                                {
                                    "key": "to",
                                    "value": "2026-10-12T23:59:59Z",
                                    "description": "Created at or before this date\/time (UTC). Must be a valid date. Must be a date after or equal to from.",
                                    "disabled": false
                                },
                                {
                                    "key": "per_page",
                                    "value": "20",
                                    "description": "Items per page, 1\u2013100 (default 20). Must be at least 1. Must not be greater than 100.",
                                    "disabled": false
                                },
                                {
                                    "key": "page",
                                    "value": "1",
                                    "description": "Page number (default 1). Must be at least 1.",
                                    "disabled": false
                                }
                            ],
                            "raw": "{{baseUrl}}\/api\/v1\/messages?status=failed&direction=out&from=2026-10-01&to=2026-10-12T23%3A59%3A59Z&per_page=20&page=1"
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Sent and received messages of this instance, newest first, paginated."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"items\":[{\"id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"instance_id\":\"01j9z8k2m3n4p5q6r7s8t9v0wx\",\"direction\":\"out\",\"phone\":\"201001234567\",\"type\":\"text\",\"content\":{\"text\":\"Your order #1042 has shipped.\"},\"status\":\"read\",\"error\":null,\"wa_message_id\":\"3EB0C1D2E3F4A5B6C7D8\",\"sent_at\":\"2026-10-12T10:05:03Z\",\"delivered_at\":\"2026-10-12T10:05:04Z\",\"read_at\":\"2026-10-12T10:07:40Z\",\"created_at\":\"2026-10-12T10:05:00Z\"}],\"pagination\":{\"page\":1,\"per_page\":20,\"total\":1,\"last_page\":1}},\"error\":null}",
                            "name": ""
                        }
                    ]
                },
                {
                    "name": "Get a message",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8q0a1b2c3d4e5f6g7h8j9",
                                    "description": "The message ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "`direction` is `out` (sent by you) or `in` (received). Incoming media messages include\n`content.media` with `id`, `mime`, `size` and `file_name`; `content.media.error` is set\nif the file could not be stored (`too_large`, `download_failed`). Failed outgoing\nmessages have an `error` code, e.g. `not_on_whatsapp`, `invalid_payload`,\n`media_url_blocked`, `media_too_large`, `media_http_error`, `send_failed`."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"instance_id\":\"01j9z8k2m3n4p5q6r7s8t9v0wx\",\"direction\":\"out\",\"phone\":\"201001234567\",\"type\":\"text\",\"content\":{\"text\":\"Your order #1042 has shipped.\"},\"status\":\"read\",\"error\":null,\"wa_message_id\":\"3EB0C1D2E3F4A5B6C7D8\",\"sent_at\":\"2026-10-12T10:05:03Z\",\"delivered_at\":\"2026-10-12T10:05:04Z\",\"read_at\":\"2026-10-12T10:07:40Z\",\"created_at\":\"2026-10-12T10:05:00Z\"},\"error\":null}",
                            "name": "Outgoing, read"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"not_found\",\"message\":\"Resource not found.\"}}",
                            "name": "Unknown or other instance's message"
                        }
                    ]
                },
                {
                    "name": "Download received media",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/:id\/media",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/:id\/media",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8q0a1b2c3d4e5f6g7h8j9",
                                    "description": "The message ID."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "The file of an incoming image, video, audio or document message (the `mediaId` in the\n`message.received` webhook is the message id). Returns the raw file with its\n`Content-Type`, not JSON. Files are kept for 30 days, then this returns\n`410 media_expired`: download what you need to keep."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "<binary file, e.g. Content-Type: image\/jpeg>",
                            "name": "The file (binary)"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"media_not_found\",\"message\":\"This message has no stored media.\"}}",
                            "name": "No media \/ not your message"
                        },
                        {
                            "header": [],
                            "code": 410,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"media_expired\",\"message\":\"The file was deleted under the retention policy.\"}}",
                            "name": "Deleted by retention"
                        }
                    ]
                },
                {
                    "name": "Cancel a message",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8q0a1b2c3d4e5f6g7h8j9",
                                    "description": "The message ID."
                                }
                            ]
                        },
                        "method": "DELETE",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Cancels an outgoing message that has not been sent yet: a scheduled one (`send_at`) or\none still waiting in the queue. Its status becomes `cancelled`. Messages already sent\ncannot be recalled."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"status\":\"cancelled\",\"scheduled_at\":\"2026-10-20T09:00:00Z\"},\"error\":null}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"message_not_cancellable\",\"message\":\"Only queued outgoing messages can be cancelled; this one is delivered.\"}}",
                            "name": "Already sent"
                        }
                    ]
                },
                {
                    "name": "Mark a message as read",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/:id\/read",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/:id\/read",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8q0a1b2c3d4e5f6g7h8j9",
                                    "description": "The message ID (a received message)."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Sends a read receipt for a message you received: the sender sees blue ticks, as if you\nopened the chat. `read_at` is set. To do this for every new message automatically,\nturn on `auto_read` (see \"Update instance settings\"). Read receipts are only shown if\nyour number has them enabled in WhatsApp's privacy settings."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"direction\":\"in\",\"status\":\"received\",\"read_at\":\"2026-10-27T10:00:05Z\"},\"error\":null}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"The number is not connected.\"}}",
                            "name": "Number not connected"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"message_not_incoming\",\"message\":\"Only received messages can be marked as read.\"}}",
                            "name": "Not a received message"
                        }
                    ]
                },
                {
                    "name": "React to a message",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/messages\/:id\/react",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/messages\/:id\/react",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8q0a1b2c3d4e5f6g7h8j9",
                                    "description": "The message ID."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"emoji\":\"\ud83d\udc4d\"}"
                        },
                        "description": "Adds an emoji reaction to a message of this chat (one you received or sent), like\nlong-pressing it in WhatsApp; `null` removes your reaction. Reactions from the other\nperson arrive on your webhook as `message.reaction`; both are in \"Get a message\"\n(`content.reactions`: `customer`, `us`)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"id\":\"01j9z8q0a1b2c3d4e5f6g7h8j9\",\"content\":{\"text\":\"Thanks!\",\"reactions\":{\"us\":\"\ud83d\udc4d\"}}},\"error\":null}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"The number is not connected right now.\"}}",
                            "name": "Number not connected"
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"message_not_sent\",\"message\":\"This message has not reached WhatsApp yet.\"}}",
                            "name": "Not on WhatsApp yet"
                        }
                    ]
                }
            ]
        },
        {
            "name": "OTP",
            "description": "\nVerify a user's phone number with a one-time code sent over WhatsApp: send a code, then\ncheck what the user typed. We generate and keep the code (only a hash of it), so you do\nnot have to.\n\n- A code works once, until it expires, for at most 5 tries.\n- Per number: at most 3 codes in 10 minutes, and 30 seconds between two (`429\n  otp_rate_limited` with `data.retry_after` seconds).\n- It is sent like any message (pacing, daily limit), so it usually arrives within seconds;\n  its delivery is reported as usual (`message.status` webhook, `message_id`).\n- Add `link` for a \"magic link\": the message then has a link with the code in it, for\n  one-tap login on your site (your page sends the code to \"Verify a code\").\n\n**Reverse OTP** (\"Create a reverse code\"): instead of us messaging the user, the user\nmessages your number. Show them the returned `link` (a wa.me link with the code already\ntyped) or a QR of it; when their message arrives the code is verified, you get an\n`otp.verified` webhook (sent to your webhook URL whatever events you picked), and\n\"Get a code's status\" says `verified` with the user's `phone`. No chat is started by your\nnumber, so it is safer for it, and it counts as half a code. These messages are not filed\nin the team inbox.\n\nCodes count against your plan's OTP allowance (Billing): above it they are billed per code\nwith your next payment, up to a monthly limit (`402 otp_limit_reached` after that).",
            "item": [
                {
                    "name": "Send a code",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/otp",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/otp"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"to\":\"+201001234567\",\"length\":6,\"expires_in\":300,\"language\":\"ar\",\"brand\":\"ZONE\",\"link\":\"https:\\\/\\\/example.com\\\/login?code={code}\"}"
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\"success\":true,\"data\":{\"otp_id\":\"01jb2x4m0f8a9c3d7e6g5h4k2n\",\"to\":\"201001234567\",\"expires_at\":\"2026-11-01T10:05:00Z\",\"message_id\":\"01jb2x4m1a2b3c4d5e6f7g8h9j\"},\"error\":null}",
                            "name": "Sent"
                        },
                        {
                            "header": [],
                            "code": 429,
                            "body": "{\"success\":false,\"data\":{\"retry_after\":22},\"error\":{\"code\":\"otp_rate_limited\",\"message\":\"Too many codes for this number. Try again later.\"}}",
                            "name": "Too many codes"
                        }
                    ]
                },
                {
                    "name": "Verify a code",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/otp\/verify",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/otp\/verify"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"otp_id\":\"01jb2x4m0f8a9c3d7e6g5h4k2n\",\"code\":\"482913\"}"
                        },
                        "description": "Always `200`: check `data.valid`. When it is `false`, `data.reason` is `wrong_code`\n(with `attempts_left`), `expired`, `too_many_attempts`, `already_used` or `not_found`."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"valid\":true,\"reason\":null,\"attempts_left\":null,\"otp_id\":\"01jb2x4m0f8a9c3d7e6g5h4k2n\"},\"error\":null}",
                            "name": "Valid"
                        },
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"valid\":false,\"reason\":\"wrong_code\",\"attempts_left\":4,\"otp_id\":\"01jb2x4m0f8a9c3d7e6g5h4k2n\"},\"error\":null}",
                            "name": "Wrong code"
                        }
                    ]
                },
                {
                    "name": "Create a reverse code",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/otp\/reverse",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/otp\/reverse"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"phone\":\"+201001234567\",\"length\":6,\"expires_in\":300,\"language\":\"ar\",\"brand\":\"ZONE\",\"reply\":\"\u062a\u0645 \u0627\u0644\u062a\u062d\u0642\u0642 \u0645\u0646 \u0631\u0642\u0645\u0643 \u2705\"}"
                        },
                        "description": ""
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 201,
                            "body": "{\"success\":true,\"data\":{\"otp_id\":\"01jb2x4m0f8a9c3d7e6g5h4k2n\",\"code\":\"482913\",\"text\":\"\u0643\u0648\u062f \u0627\u0644\u062a\u062d\u0642\u0642: 482913\",\"link\":\"https:\/\/wa.me\/201001234567?text=%D9%83%D9%88%D8%AF%20%D8%A7%D9%84%D8%AA%D8%AD%D9%82%D9%82%3A%20482913\",\"expires_at\":\"2026-11-01T10:05:00Z\"},\"error\":null}",
                            "name": "Created"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"The number is not connected.\"}}",
                            "name": "Number not connected"
                        }
                    ]
                },
                {
                    "name": "Get a code's status",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/otp\/:id",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/otp\/:id",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01jb2x4m0f8a9c3d7e6g5h4k2n",
                                    "description": "The otp_id."
                                }
                            ]
                        },
                        "method": "GET",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "`status` is `pending`, `verified` or `expired`. For a reverse code, `phone` is the\nnumber that sent it once verified."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"otp_id\":\"01jb2x4m0f8a9c3d7e6g5h4k2n\",\"mode\":\"reverse\",\"status\":\"verified\",\"phone\":\"201001234567\",\"expires_at\":\"2026-11-01T10:05:00Z\",\"verified_at\":\"2026-11-01T10:01:12Z\"},\"error\":null}",
                            "name": "Verified"
                        },
                        {
                            "header": [],
                            "code": 404,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"otp_not_found\",\"message\":\"OTP not found.\"}}",
                            "name": "Unknown id"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Contacts",
            "description": "",
            "item": [
                {
                    "name": "Check a number",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/contacts\/check",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/contacts\/check"
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"phone\":\"+201001234567\"}"
                        },
                        "description": "Is this phone number on WhatsApp? Results are cached for 24 hours. You do not need to\ncall this before sending: every send already checks the recipient. Limited to 20\nrequests per minute, because many lookups in a row can get a number flagged."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"phone\":\"201001234567\",\"exists\":true},\"error\":null}",
                            "name": "On WhatsApp"
                        },
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"phone\":\"201009999999\",\"exists\":false},\"error\":null}",
                            "name": "Not on WhatsApp"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"instance_not_connected\",\"message\":\"Instance is not connected to WhatsApp.\"}}",
                            "name": "Instance not connected"
                        }
                    ]
                }
            ]
        },
        {
            "name": "Webhooks",
            "description": "\nWe POST events to your `webhook_url` as JSON. Respond with any `2xx` within 10 seconds;\nanything else (or a timeout) is retried after 10 s, 1 min, 5 min, 30 min and 2 h. Respond\n`410 Gone` to stop retries for an event. The same event can arrive more than once, so\nde-duplicate on `id`. Your URL must be public `http`\/`https` (internal addresses are refused)\nand redirects are not followed.\n\nDeliveries can arrive out of order (a retried `sent` after a `read`, for example). For\n`message.status`, keep the most advanced status: `sent` < `delivered` < `read`; `failed` is final.\n\n### Events\n| event | when | `data` |\n|---|---|---|\n| `message.received` | someone sent your number a message | `messageId`, `from`, `senderName`, `type`, `text`, `caption`, `mediaId`, `mediaMime`, `location`, `timestamp` |\n| `message.sent_from_phone` | you sent a message yourself from the phone or WhatsApp Web (not through the API), so your copy of the chat stays complete | `messageId`, `to`, `type`, `text`, `caption`, `mediaMime`, `fileName`, `location`, `timestamp` |\n| `message.reaction` | someone reacted to a message (or you did, from the phone) | `messageId`, `emoji` (`null` = reaction removed), `by` (`customer` or `us`), `from` |\n| `message.poll_vote` | someone voted on your poll (or changed \/ removed their vote) | `messageId` (the poll), `from`, `selected` (their current answers; empty = vote removed), `votedAt` |\n| `message.status` | a message you sent changed status | `messageId`, `status` (`sent`, `delivered`, `read`, `failed`), `timestamp`, and `error` when `failed` (e.g. `not_on_whatsapp`) |\n| `instance.connected` \/ `instance.disconnected` \/ `instance.logged_out` \/ `instance.banned` | the number's connection changed | `phone`, `reason` |\n| `instance.paused` | sending was paused after repeated failures | `reason`, `failures` |\n| `instance.restriction` | WhatsApp's limit on new chats changed (timelock started or ended, or the new-chat cap moved to `FIRST_WARNING`, `SECOND_WARNING`, `CAPPED` or back to `NONE`) | `timelock` (`active`, `until`, `type`), `newChatCap` (`status`, `used`, `total`, `resetsAt`) |\n| `otp.verified` | a user sent your number a reverse OTP code (see OTP). Sent to every webhook URL, whatever events you picked | `otp_id`, `mode` (`reverse`), `status`, `phone`, `expires_at`, `verified_at` |\n\nExample body:\n\n```json\n{\n  \"id\": \"01J9Z9C4H7K2M5P8R1T4W7Y0B3\",\n  \"event\": \"message.received\",\n  \"instance_id\": \"01j9z8k2m3n4p5q6r7s8t9v0wx\",\n  \"data\": { \"messageId\": \"01j9z9c4...\", \"from\": \"201001234567\", \"senderName\": \"Ahmed\", \"type\": \"text\", \"text\": \"Hi, is my order ready?\", \"timestamp\": \"2026-10-12T10:20:00.000Z\" },\n  \"occurred_at\": \"2026-10-12T10:20:00.412Z\",\n  \"sent_at\": \"2026-10-12T10:20:00.530Z\"\n}\n```\n\n### Verifying the signature\nEvery request carries two headers:\n\n- `X-Timestamp`: Unix time in seconds when we signed the request\n- `X-Signature`: hex `HMAC-SHA256(X-Timestamp + \".\" + raw request body, your webhook secret)`\n\nAlways verify before trusting a webhook. Compute the HMAC over the **raw** body bytes\n(before any JSON parsing), compare in constant time, and reject timestamps older than\n5 minutes to stop replays. Your secret is returned by \"Set the webhook\".\n\n**PHP (Laravel)**\n\n```php\nRoute::post('\/wa-webhook', function (Illuminate\\Http\\Request $request) {\n    $secret = env('WA_WEBHOOK_SECRET');\n    $timestamp = $request->header('X-Timestamp');\n    $signature = $request->header('X-Signature');\n    $raw = $request->getContent();\n\n    $expected = hash_hmac('sha256', $timestamp.'.'.$raw, $secret);\n    if (! $signature || ! hash_equals($expected, $signature) || abs(time() - (int) $timestamp) > 300) {\n        abort(401);\n    }\n\n    $event = json_decode($raw, true);\n    \/\/ de-duplicate on $event['id'], then handle $event['event'] \/ $event['data']\n    return response()->noContent();\n});\n```\n\n**Plain PHP**\n\n```php\n$raw = file_get_contents('php:\/\/input');\n$timestamp = $_SERVER['HTTP_X_TIMESTAMP'] ?? '';\n$signature = $_SERVER['HTTP_X_SIGNATURE'] ?? '';\n$expected = hash_hmac('sha256', $timestamp.'.'.$raw, getenv('WA_WEBHOOK_SECRET'));\n\nif (!hash_equals($expected, $signature) || abs(time() - (int) $timestamp) > 300) {\n    http_response_code(401);\n    exit;\n}\n$event = json_decode($raw, true);\nhttp_response_code(200);\n```\n\n**Node.js (Express)**\n\n```javascript\nconst crypto = require('crypto');\nconst express = require('express');\nconst app = express();\n\n\/\/ Keep the raw body: the signature is over the exact bytes we sent.\napp.post('\/wa-webhook', express.raw({ type: 'application\/json' }), (req, res) => {\n  const timestamp = req.get('X-Timestamp') || '';\n  const signature = req.get('X-Signature') || '';\n  const expected = crypto\n    .createHmac('sha256', process.env.WA_WEBHOOK_SECRET)\n    .update(`${timestamp}.${req.body}`)\n    .digest('hex');\n\n  const valid =\n    signature.length === expected.length &&\n    crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected)) &&\n    Math.abs(Date.now() \/ 1000 - Number(timestamp)) <= 300;\n  if (!valid) return res.sendStatus(401);\n\n  const event = JSON.parse(req.body);\n  \/\/ de-duplicate on event.id, then handle event.event \/ event.data\n  res.sendStatus(200);\n});\n```",
            "item": [
                {
                    "name": "Set the webhook",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances\/:id\/webhook",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances\/:id\/webhook",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8k2m3n4p5q6r7s8t9v0wx",
                                    "description": "The instance ID."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\"url\":\"https:\\\/\\\/example.com\\\/wa-webhook\",\"events\":[\"message.received\"],\"rotate_secret\":false}"
                        },
                        "description": "Sets where events are sent (`url`, or `null` to stop sending) and which `events` you want\n(a new number starts with `message.received`, `message.status`, `message.sent_from_phone`,\n`message.reaction`, `message.poll_vote` and `instance.restriction`). The response includes the\nsigning `secret`; pass `rotate_secret: true` to replace it (the old one stops working\nimmediately)."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"url\":\"https:\/\/example.com\/wa-webhook\",\"events\":[\"message.received\",\"message.status\",\"instance.disconnected\"],\"secret\":\"Xq3vT9bL2mN7pR4sW8yZ1cF6hJ0kD5gA\",\"signature\":\"X-Signature = hex HMAC-SHA256(X-Timestamp + \\\".\\\" + raw body, secret)\"},\"error\":null}",
                            "name": ""
                        },
                        {
                            "header": [],
                            "code": 422,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"validation_failed\",\"message\":\"The url must point to a public internet address.\",\"fields\":{\"url\":[\"The url must point to a public internet address.\"]}}}",
                            "name": "Internal or invalid URL"
                        }
                    ]
                },
                {
                    "name": "Send a test event",
                    "request": {
                        "url": {
                            "host": "{{baseUrl}}",
                            "path": "api\/v1\/instances\/:id\/webhook\/test",
                            "query": [],
                            "raw": "{{baseUrl}}\/api\/v1\/instances\/:id\/webhook\/test",
                            "variable": [
                                {
                                    "id": "id",
                                    "key": "id",
                                    "value": "01j9z8k2m3n4p5q6r7s8t9v0wx",
                                    "description": "The instance ID."
                                }
                            ]
                        },
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "value": "application\/json"
                            },
                            {
                                "key": "Accept",
                                "value": "application\/json"
                            }
                        ],
                        "body": null,
                        "description": "Sends one signed `webhook.test` event to your URL right away and tells you what your\nserver answered. Use it to check your signature verification."
                    },
                    "response": [
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"delivery_id\":\"01J9Z9D2F5H8K1M4P7R0T3W6Y9\",\"delivered\":true,\"response_code\":200,\"error\":null},\"error\":null}",
                            "name": "Delivered"
                        },
                        {
                            "header": [],
                            "code": 200,
                            "body": "{\"success\":true,\"data\":{\"delivery_id\":\"01J9Z9D2F5H8K1M4P7R0T3W6Y9\",\"delivered\":false,\"response_code\":500,\"error\":\"HTTP 500: Internal Server Error\"},\"error\":null}",
                            "name": "Your server failed"
                        },
                        {
                            "header": [],
                            "code": 409,
                            "body": "{\"success\":false,\"data\":null,\"error\":{\"code\":\"webhook_not_configured\",\"message\":\"Set a webhook URL first.\"}}",
                            "name": "No URL set"
                        }
                    ]
                }
            ]
        }
    ],
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "Authorization",
                "type": "string"
            }
        ]
    }
}