{
  "info": {
    "_postman_id": "fe342926-be67-5fc5-a693-8c4024547fb9",
    "name": "Sozuri WhatsApp API (HTTP, api_token)",
    "description": "Send WhatsApp messages, hear about them as they happen, and manage contacts, the Team Inbox, broadcasts and templates on Sozuri.\n\n**Before you press Send**\n1. In Sozuri, open **Developers → API Token**, press **Regenerate Token** and copy it. Regenerating replaces the old token.\n2. Open this collection's **Variables** tab. Set `api_token`, and set `to` to **your own** WhatsApp number (no spaces). Save.\n3. Set the template variables to approved templates in your account. **List templates** shows their names, and in `fields`, how many values each needs.\n\n**Send a template** saves the message ID, so **Check delivery** works straight after it.\n\n**Inside the 24 hours** (photos, buttons, lists…) and **Messages you received** work once your number has written to your business number. Message it from your phone first. **Webhooks** needs the `webhook_url` variable, **Assign** the `agent` one and **Submit a new template** a `new_template` name. Until they are set those requests are refused, and nothing happens.\n\n**Clean up** runs last: it deletes the test webhook and your test contact.\n\nThe token goes in the request as `api_token`: in the JSON body of a POST, in the address of a GET. Your plan must include API access; the API takes up to 60 requests a minute.\n\nFull guide, fields and errors: https://automation.sozuri.net/docs/whatsapp.html#api",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Send messages",
      "item": [
        {
          "name": "Send a template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "Sends an approved template. `params` holds the message values `{{1}}`, `{{2}}` … in order: change them to match your template, one for each value (**List templates** shows how many, in `fields.params`).\n\nThe answer's `data.message_id` is Meta's ID for the message (the wamid). This request saves it for **Check delivery**.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"template\": \"{{template}}\",\n  \"params\": [\n    \"Amina\",\n    \"ORD-1043\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a template with a text heading",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "For a template whose text heading takes a value (`\"header_type\": \"TEXT\"`, `fields.headerParams` 1): the heading's value goes in `headerParams`, the message values in `params`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"template\": \"{{template_with_heading}}\",\n  \"headerParams\": [\n    \"ORD-1044\"\n  ],\n  \"params\": [\n    \"Brian\",\n    \"ORD-1044\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a template with a picture heading",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "For a template with a picture, video or document heading (`\"media\": true`): put a public https link in `media.url` (set the `media_url` variable). Meta downloads it, so it must open without a login. For a document, add `\"filename\"`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"template\": \"{{template_with_picture}}\",\n  \"media\": {\n    \"url\": \"{{media_url}}\"\n  },\n  \"params\": [\n    \"Esther\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a template with a button value",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "For a template whose button link takes a value (`fields.buttonParams` 1): the value goes in `buttonParams`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"template\": \"{{template_with_button}}\",\n  \"params\": [\n    \"David\"\n  ],\n  \"buttonParams\": [\n    \"ORD-1045\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Reply in your own words",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "Free text. It is delivered only if this number wrote to you in the last 24 hours; otherwise the answer is `409` with `\"code\": \"window_closed\"` and nothing is sent. Message your business number from your phone first to try it.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"message\": \"Thanks, your order is on its way.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send with AiSensy field names",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "The same send, with the field names of the reseller API many businesses move from: `destination`, `campaignName`, `templateParams`. A `campaignName` that is not a saved campaign is used as the template name, with a note in `warnings`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"destination\": \"{{to}}\",\n  \"campaignName\": \"{{template}}\",\n  \"templateParams\": [\n    \"Faith\",\n    \"ORD-1046\"\n  ],\n  \"source\": \"Postman\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a template, all in the address (GET)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send?api_token={{api_token}}&to={{to}}&template={{template}}&params[]=Amina&params[]=ORD-1043",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "to",
                  "value": "{{to}}"
                },
                {
                  "key": "template",
                  "value": "{{template}}"
                },
                {
                  "key": "params[]",
                  "value": "Amina"
                },
                {
                  "key": "params[]",
                  "value": "ORD-1043"
                }
              ]
            },
            "description": "For tools that can only open an address. Each value must be encoded, which Postman does for you. A token in an address can end up in logs along the way, so use the POST version where you can."
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Templates and delivery",
      "item": [
        {
          "name": "List templates",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/templates?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "templates"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "Your approved templates. For each one, `fields` says how many values go in `params`, `headerParams` and `buttonParams`, and whether it needs `media`; `header_type` is the heading's format, or null."
          },
          "response": []
        },
        {
          "name": "List all templates, with pending and rejected",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/templates?api_token={{api_token}}&all=1",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "templates"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "all",
                  "value": "1"
                }
              ]
            },
            "description": "The same list, with templates Meta has not approved yet or has rejected, and Meta's reason in `rejected_reason`."
          },
          "response": []
        },
        {
          "name": "Check delivery",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/status/{{message_id}}?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "status",
                "{{message_id}}"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "The latest state of a message you sent: `sent`, `delivered`, `read` or `failed`, as Meta reports it. Uses the `message_id` saved by the last send."
          },
          "response": []
        },
        {
          "name": "Submit a new template",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "A new value on every press ({{$guid}}). Send the SAME value again to retry safely."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/templates/create",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "templates",
                "create"
              ]
            },
            "description": "Writes a template and submits it to Meta for review: the same checks as the Templates page, so what Meta would refuse is refused here first, with the reason. Set the `new_template` variable to a new name first. Meta answers within minutes, at most 24 hours: `template.approved` or `template.rejected` tells your webhook.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"name\": \"{{new_template}}\",\n  \"category\": \"UTILITY\",\n  \"language\": \"en\",\n  \"body\": \"Hi {{1}}, your order {{2}} is ready for collection.\",\n  \"examples\": [\n    \"Amina\",\n    \"ORD-1043\"\n  ],\n  \"footer\": \"Reply to this message with any questions.\",\n  \"buttons\": [\n    \"Thanks\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Check a new template's review",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/templates/{{new_template}}?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "templates",
                "{{new_template}}"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "PENDING until Meta has reviewed it, then APPROVED or REJECTED (with the reason)."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Contacts and tags",
      "item": [
        {
          "name": "Save a contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts"
              ]
            },
            "description": "Saves the number in WhatsApp → Contacts, or updates the contact that has it: `201` when new, `200` when it existed. `name` fills a blank name only; add `\"overwrite_name\": true` to replace it. New tag names create the tag.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"phone\": \"{{to}}\",\n  \"name\": \"Postman test\",\n  \"tags\": [\n    \"postman\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Read a contact",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "One contact: name, opt-in, source, tags, groups and when they last wrote to you."
          },
          "response": []
        },
        {
          "name": "Add tags",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/tags",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "tags"
              ]
            },
            "description": "Adds tags to the contact. A name that is not a tag yet creates it. The contact must exist.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"tags\": [\n    \"vip\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove tags",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/tags/remove",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "tags",
                "remove"
              ]
            },
            "description": "Takes tags off the contact. Names that are not tags are ignored.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"tags\": [\n    \"vip\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Opt out",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/opt-out",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "opt-out"
              ]
            },
            "description": "No campaign reaches this person until they opt in again.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Opt in",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/opt-in",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "opt-in"
              ]
            },
            "description": "Reverses an opt-out. Refused for a number on your blacklist.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List tags",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/tags?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "tags"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "Every tag, with how many people carry it."
          },
          "response": []
        },
        {
          "name": "Create a tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/tags",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "tags"
              ]
            },
            "description": "Creates a tag: `201`, or `200` with `\"created\": false` when a tag with that name already exists in any case. The category is `manual` (the default), `first_message`, `api` or `broadcast`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"name\": \"Nairobi\",\n  \"category\": \"manual\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Rename a tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/tags/Nairobi/rename",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "tags",
                "Nairobi",
                "rename"
              ]
            },
            "description": "Renames the tag; everyone who carries it keeps it. The tag is named in the address by its name or its `id` from **List tags**. A name another tag already has is refused with `409`: merge them on the Tags page instead.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"name\": \"Nairobi CBD\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Update a contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}"
              ]
            },
            "description": "Changes an existing contact. `name` REPLACES the current name. `attributes` are the contact's fields (Company, Email…), named by key or label; `\"\"` empties one. An attribute the book does not have yet is listed back in `ignored_attributes`, unless you send `\"create_attributes\": true`, which adds it. **List attributes** shows what there is.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"name\": \"Postman test\",\n  \"attributes\": {\n    \"COMPANY\": \"Postman Ltd\",\n    \"City\": \"Nairobi\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "List attributes",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/attributes?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "attributes"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "The fields a contact can carry, with their keys: what `attributes` takes, and what broadcasts can personalise with."
          },
          "response": []
        },
        {
          "name": "List groups",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/groups?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "groups"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "Your contact groups, with how many people each holds. `whatsapp_book` marks \"WhatsApp Contacts\", where every WhatsApp chat is filed."
          },
          "response": []
        },
        {
          "name": "Add to a group",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/groups",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "groups"
              ]
            },
            "description": "Puts the contact in one or more groups, by name or `id`. Every group must exist.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"groups\": [\n    \"{{group}}\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Remove from a group",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/groups/remove",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "groups",
                "remove"
              ]
            },
            "description": "Takes the contact out of groups. Refused for \"WhatsApp Contacts\" and for their only group: delete the contact instead.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"groups\": [\n    \"{{group}}\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete a tag",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/tags/Nairobi%20CBD/delete",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "tags",
                "Nairobi%20CBD",
                "delete"
              ]
            },
            "description": "Deletes the tag and takes it off everyone; the contacts stay. Named by name or `id`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Messages you received",
      "item": [
        {
          "name": "List messages you received",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/messages?api_token={{api_token}}&direction=inbound&limit=10",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "messages"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "direction",
                  "value": "inbound"
                },
                {
                  "key": "limit",
                  "value": "10"
                }
              ]
            },
            "description": "Newest first. Each one has its `id`, who sent it, the text, and for a photo or document a `media.download_url` that works without a token for 7 days. Add `since` (an ISO time such as 2026-10-02T09:00:00+03:00) to get only newer ones; `next_cursor` pages back. This request keeps the newest message's id for the next three."
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep inbound_message_id for the requests that follow.",
                  "const body = pm.response.json();",
                  "const v = body && body.data ? body.data.messages && body.data.messages[0] ? body.data.messages[0].id : undefined : undefined;",
                  "if (v) { pm.collectionVariables.set(\"inbound_message_id\", v); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Mark as read, and show typing",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/messages/{{inbound_message_id}}/read",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "messages",
                "{{inbound_message_id}}",
                "read"
              ]
            },
            "description": "Blue ticks on their phone, and the Team Inbox counts it as read. `typing` shows \"typing…\" until you reply, for up to 25 seconds.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"typing\": true\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Reply quoting their message",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "`reply_to` shows their message quoted above yours. Works with every kind of message you send.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"message\": \"Yes, we deliver there. It is KES 300.\",\n  \"reply_to\": \"{{inbound_message_id}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "React with an emoji",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "Puts an emoji on their message. Send `\"emoji\": \"\"` to take it off.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"type\": \"reaction\",\n  \"message_id\": \"{{inbound_message_id}}\",\n  \"emoji\": \"👍\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Inside the 24 hours",
      "item": [
        {
          "name": "Send a photo with a caption",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "Like your own words, these reach only someone who wrote to you in the last 24 hours; otherwise `409 window_closed`. `type` can be `image`, `video`, `audio`, `document` (add `filename`) or `sticker`; the link must be public.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"type\": \"image\",\n  \"media\": {\n    \"url\": \"{{media_url}}\"\n  },\n  \"caption\": \"Your order is packed and ready.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send reply buttons",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "Up to 3 buttons, 20 characters each. A tap comes back as `message.received` and `message.button_reply`, with the button's id (`btn_1`, `btn_2`… unless you give `[{\"id\": \"yes\", \"title\": \"Yes, please\"}]`).",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"type\": \"buttons\",\n  \"text\": \"Shall we deliver tomorrow morning?\",\n  \"buttons\": [\n    \"Yes, please\",\n    \"Another day\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a list menu",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "Up to 10 rows (title 24 characters, description 72), behind a button. For groups of rows, send `sections` instead of `rows`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"type\": \"list\",\n  \"text\": \"Where should we deliver?\",\n  \"button\": \"Choose an area\",\n  \"rows\": [\n    {\n      \"id\": \"westlands\",\n      \"title\": \"Westlands\",\n      \"description\": \"KES 300, same day\"\n    },\n    {\n      \"id\": \"kilimani\",\n      \"title\": \"Kilimani\",\n      \"description\": \"KES 300, same day\"\n    },\n    {\n      \"id\": \"pickup\",\n      \"title\": \"Pick up at the shop\",\n      \"description\": \"Free\"\n    }\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a link button",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "A message with one button that opens a web address.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"type\": \"cta_url\",\n  \"text\": \"Track your parcel any time.\",\n  \"button\": \"Track order\",\n  \"url\": \"https://example.co.ke/track/ORD-1043\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Send a location",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/send",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "send"
              ]
            },
            "description": "A pin they can open in their maps app.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"to\": \"{{to}}\",\n  \"type\": \"location\",\n  \"latitude\": -1.2648,\n  \"longitude\": 36.8045,\n  \"name\": \"Our Westlands shop\",\n  \"address\": \"Sarit Centre, Westlands\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep the message ID so \"Check delivery\" works without copying it by hand.",
                  "const body = pm.response.json();",
                  "if (body && body.data && body.data.message_id) {",
                  "    pm.collectionVariables.set(\"message_id\", body.data.message_id);",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Webhooks: events to your address",
      "item": [
        {
          "name": "List events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks/events?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks",
                "events"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "Every event you can subscribe to, such as `message.received`, `message.failed`, `contact.created` and `template.approved`."
          },
          "response": []
        },
        {
          "name": "Sample events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks/events/message.received/samples?api_token={{api_token}}&limit=3",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks",
                "events",
                "message.received",
                "samples"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "limit",
                  "value": "3"
                }
              ]
            },
            "description": "The latest `message.received` events as your webhooks got them, newest first. Until one has been sent, an example in exactly the same shape (`\"source\": \"example\"`). Put any event from **List events** in the address. For a Zap's test step."
          },
          "response": []
        },
        {
          "name": "Subscribe a webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks"
              ]
            },
            "description": "Sozuri POSTs each event to your https address as it happens, signed with the `secret` in the answer. The secret is shown ONCE: keep it. `\"events\": \"*\"` subscribes to all of them. This request keeps the webhook's id.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"url\": \"{{webhook_url}}\",\n  \"events\": [\n    \"message.received\",\n    \"message.status\"\n  ],\n  \"description\": \"Postman test\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep webhook_id for the requests that follow.",
                  "const body = pm.response.json();",
                  "const v = body && body.data ? body.data.webhook ? body.data.webhook.id : undefined : undefined;",
                  "if (v) { pm.collectionVariables.set(\"webhook_id\", v); }"
                ]
              }
            }
          ]
        },
        {
          "name": "List webhooks",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "Your webhooks: their events, status, and the answer your address gave last time."
          },
          "response": []
        },
        {
          "name": "Send a test event",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks/{{webhook_id}}/test",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks",
                "{{webhook_id}}",
                "test"
              ]
            },
            "description": "Sends a signed `ping` event now and tells you what your address answered.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Recent deliveries",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks/{{webhook_id}}/deliveries?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks",
                "{{webhook_id}}",
                "deliveries"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "What was sent, how many tries it took, and what your address answered. Failed deliveries are retried for about 22 hours."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Lists, for syncing and Zapier",
      "item": [
        {
          "name": "Contacts changed recently",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts?api_token={{api_token}}&updated_since=2026-10-01T00:00:00Z&limit=25",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "updated_since",
                  "value": "2026-10-01T00:00:00Z"
                },
                {
                  "key": "limit",
                  "value": "25"
                }
              ]
            },
            "description": "Newest first, with stable `id`s. Times are ISO 8601: `Z` for UTC, or an offset such as `+03:00` (write the `+` as `%2B` in an address). Also `created_since`, `tag` (names, `|` between them) and `opted_out`. Page with `cursor` = the last answer's `next_cursor`."
          },
          "response": []
        },
        {
          "name": "Messages you sent and received",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/messages?api_token={{api_token}}&limit=25",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "messages"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "limit",
                  "value": "25"
                }
              ]
            },
            "description": "Both directions, newest first. `direction` (`inbound`/`outbound`), `phone`, `conversation_id`, `type` and `status` narrow it."
          },
          "response": []
        },
        {
          "name": "Shop orders",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/orders?api_token={{api_token}}&limit=10",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "orders"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "limit",
                  "value": "10"
                }
              ]
            },
            "description": "Orders placed in your WhatsApp shop, newest first: items, delivery, payment (with its link while unpaid) and total. `status` (placed, awaiting_payment, paid, cancelled, expired), `phone` and `since` narrow it. Webhooks: order.placed, order.paid, order.cancelled."
          },
          "response": []
        },
        {
          "name": "Conversations",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/conversations?api_token={{api_token}}&status=open",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "conversations"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "status",
                  "value": "open"
                }
              ]
            },
            "description": "Team Inbox conversations, newest activity first. Also `assigned_to` (a user id, or `none`), `phone` and `since`."
          },
          "response": []
        }
      ]
    },
    {
      "name": "Team Inbox",
      "item": [
        {
          "name": "List the team",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/team?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "team"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "The people a conversation can be assigned to."
          },
          "response": []
        },
        {
          "name": "Read the conversation",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/conversations/{{to}}?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "conversations",
                "{{to}}"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "A conversation, by its `id` or by the customer's phone number."
          },
          "response": []
        },
        {
          "name": "Assign the conversation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/conversations/{{to}}/assign",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "conversations",
                "{{to}}",
                "assign"
              ]
            },
            "description": "To a team member, by email or user id (set the `agent` variable), or `\"none\"` to unassign. Fires `conversation.assigned`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"assigned_to\": \"{{agent}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Add an internal note",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/conversations/{{to}}/notes",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "conversations",
                "{{to}}",
                "notes"
              ]
            },
            "description": "Only your team sees it, in the conversation's details in the Team Inbox.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"note\": \"Called back: delivery moved to Friday.\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Close the conversation",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/conversations/{{to}}/close",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "conversations",
                "{{to}}",
                "close"
              ]
            },
            "description": "Fires `conversation.closed`. A new message from them reopens it by itself.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Reopen it",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/conversations/{{to}}/reopen",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "conversations",
                "{{to}}",
                "reopen"
              ]
            },
            "description": "Back to open. `…/pending` marks it pending.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Broadcasts",
      "item": [
        {
          "name": "Start a broadcast to your own number",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "A new value on every press ({{$guid}}). Send the SAME value again to retry safely."
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/campaigns",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "campaigns"
              ]
            },
            "description": "A template to `tags`, `groups`, `numbers` or `\"audience\": \"all\"`. Each value is text, or `{\"attribute\": …, \"fallback\": …}` to take it from each contact. `schedule_at` sends later; `\"draft\": true` saves it on the Broadcasts page. This one goes to your own number only. The `Idempotency-Key` header means a retry never starts a second broadcast.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\",\n  \"name\": \"Postman test broadcast\",\n  \"template\": \"{{template}}\",\n  \"numbers\": [\n    \"{{to}}\"\n  ],\n  \"params\": [\n    {\n      \"attribute\": \"first_name\",\n      \"fallback\": \"there\"\n    },\n    \"ORD-1043\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Keep campaign_id for the requests that follow.",
                  "const body = pm.response.json();",
                  "const v = body && body.data ? body.data.campaign ? body.data.campaign.id : undefined : undefined;",
                  "if (v) { pm.collectionVariables.set(\"campaign_id\", v); }"
                ]
              }
            }
          ]
        },
        {
          "name": "Check its progress",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/campaigns/{{campaign_id}}?api_token={{api_token}}",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "campaigns",
                "{{campaign_id}}"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                }
              ]
            },
            "description": "Status and counts: audience, pending, sent, delivered, read, replied, failed. `campaign.completed` fires when it is done."
          },
          "response": []
        },
        {
          "name": "List broadcasts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/campaigns?api_token={{api_token}}&limit=10",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "campaigns"
              ],
              "query": [
                {
                  "key": "api_token",
                  "value": "{{api_token}}"
                },
                {
                  "key": "limit",
                  "value": "10"
                }
              ]
            },
            "description": "Newest first; `status` narrows it."
          },
          "response": []
        },
        {
          "name": "Cancel it",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/campaigns/{{campaign_id}}/cancel",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "campaigns",
                "{{campaign_id}}",
                "cancel"
              ]
            },
            "description": "Stops it for good: whoever has not been sent it yet is skipped. `…/pause` and `…/resume` are there too. Once it has finished, the answer is `409`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    },
    {
      "name": "Clean up",
      "item": [
        {
          "name": "Delete the webhook",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/webhooks/{{webhook_id}}/delete",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "webhooks",
                "{{webhook_id}}",
                "delete"
              ]
            },
            "description": "Removes the webhook. Sozuri stops sending to it at once.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        },
        {
          "name": "Delete the test contact",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{base_url}}/api/http/whatsapp/contacts/{{to}}/delete",
              "host": [
                "{{base_url}}"
              ],
              "path": [
                "api",
                "http",
                "whatsapp",
                "contacts",
                "{{to}}",
                "delete"
              ]
            },
            "description": "Deletes YOUR test number from the contact book (every group). Your chats stay in the Team Inbox. Needs the Delete contact permission. Fires `contact.deleted`.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"api_token\": \"{{api_token}}\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://automation.sozuri.net",
      "type": "string",
      "description": "The Sozuri address. Leave as it is."
    },
    {
      "key": "api_token",
      "value": "",
      "type": "string",
      "description": "Your API token: in Sozuri, Developers → API Token → Regenerate Token."
    },
    {
      "key": "to",
      "value": "",
      "type": "string",
      "description": "Your own WhatsApp number, with no spaces: 0712345678 or 254712345678. Every request sends to, or reads, this number."
    },
    {
      "key": "template",
      "value": "order_ready",
      "type": "string",
      "description": "An approved template whose values are all message values ({{1}}, {{2}} …)."
    },
    {
      "key": "template_with_heading",
      "value": "delivery_update",
      "type": "string",
      "description": "An approved template with a text heading that takes a value."
    },
    {
      "key": "template_with_picture",
      "value": "new_stock",
      "type": "string",
      "description": "An approved template with a picture heading."
    },
    {
      "key": "template_with_button",
      "value": "payment_link",
      "type": "string",
      "description": "An approved template with a button that takes a value."
    },
    {
      "key": "media_url",
      "value": "",
      "type": "string",
      "description": "A public https link to a picture, for the picture-heading request."
    },
    {
      "key": "message_id",
      "value": "",
      "type": "string",
      "description": "Filled in by \"Send a template\", so \"Check delivery\" works straight away."
    },
    {
      "key": "inbound_message_id",
      "value": "",
      "type": "string",
      "description": "Filled in by \"List messages you received\": the newest message someone sent you."
    },
    {
      "key": "webhook_url",
      "value": "",
      "type": "string",
      "description": "An https address of yours that receives events: a Zapier \"Catch Hook\", or a test address from webhook.site."
    },
    {
      "key": "webhook_id",
      "value": "",
      "type": "string",
      "description": "Filled in by \"Subscribe a webhook\"."
    },
    {
      "key": "agent",
      "value": "",
      "type": "string",
      "description": "A team member's email or user id, for \"Assign the conversation\". \"List the team\" shows them."
    },
    {
      "key": "group",
      "value": "VIP customers",
      "type": "string",
      "description": "One of your contact groups. \"List groups\" shows them."
    },
    {
      "key": "new_template",
      "value": "",
      "type": "string",
      "description": "A name for a NEW template to submit to Meta: lowercase letters, digits and _, e.g. order_ready_v2. Empty means nothing is submitted."
    },
    {
      "key": "campaign_id",
      "value": "",
      "type": "string",
      "description": "Filled in by \"Start a broadcast to your own number\"."
    }
  ]
}
