Docs / API reference

Chatpaat API

Connect WhatsApp to your website, store, app or CRM. Send order updates, add sign-ups as contacts, start drip sequences, put enquiries in your pipeline, and hear about every reply with webhooks.

https://www.chatpaat.com/api/v1REST + JSONPro plan

Postman collection

Every endpoint, ready to send

In Postman, choose Import and paste the collection or the link. Then set the apiKey variable to your key and hit Send.

Build it with AI

For Claude, ChatGPT, Cursor, Copilot…

Copy this prompt into your AI assistant. It has the whole API, the webhooks and the rules, so it can write the integration for your own platform.

Quick start

  1. 1

    Get the Pro plan

    The API and webhooks are part of the Pro plan. You can see your plan under Billing in the app.

  2. 2

    Create an API key

    In the app, open Developers and create a key. Copy it right away: it's shown only once. Keep it on your server, never in a website or mobile app.

  3. 3

    Send your first message

    Call POST /api/v1/messages with an approved template, like the example. The message arrives on WhatsApp in seconds.

  4. 4

    Listen for replies

    Add a webhook URL under Developers and pick events such as message.received. Chatpaat posts them to your server as they happen.

  5. Open Developers in the app
curl -X POST "https://www.chatpaat.com/api/v1/messages" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+919876543210","template":{"name":"order_shipped","language":"en","bodyParams":["Priya","#CP2041"]}}'

Authentication

Send your API key in the Authorization header of every request. Keys start with cp_live_ and belong to one workspace. Revoke a key under Developers at any time; it stops working at once.

Header
Authorization: Bearer cp_live_your_key_here

Phone numbers always include the country code, like +919876543210. Spaces, dashes and the + are optional. Free-text messages work within 24 hours of the customer's last message; after that, send an approved template.

Errors

Errors come back with a 4xx or 5xx status and a JSON body like {"error": "Invalid or revoked API key"}.

400Something in the request is wrong: a missing field, a phone number without country code, or a closed 24-hour window. error says what; validation errors also list issues.
401The API key is missing, wrong or revoked.
402Your plan doesn't include the API. It's part of the Pro plan.
403This workspace is paused.
404The message, contact, template, sequence, deal or product doesn't exist in your workspace.
409No WhatsApp number is connected yet, or a product with that ID already exists.
502WhatsApp (Meta) had a problem. code and details carry Meta's error. Safe to retry later.

Pagination

Lists return data and nextCursor. Pass limit (up to 200, default 50), and to get the next page pass cursor with the last nextCursor. It's null on the last page.

Messages

Send WhatsApp messages and check whether they were delivered and read.

Send a message

POST/api/v1/messages

Send a WhatsApp message to a phone number. Send text to reply within 24 hours of the customer's last message, or an approved template at any time (order updates, reminders, offers). The contact is created if it's new.

Body

  • tostringrequired

    Phone number with country code, e.g. +919876543210. Spaces and dashes are fine.

  • textstring

    Free text, up to 4096 characters. Only works inside the 24-hour reply window.

  • template.namestring

    Name of an approved template.

  • template.languagestring

    Language code such as en or hi. Optional if you have only one language.

  • template.bodyParamsstring[]

    Values for {{1}}, {{2}}… in the template body, in order. Send exactly as many as the template has.

  • template.headerParamsstring[]

    The value for {{1}} in a text header.

  • template.headerMediaUrlstring

    Image, video or document headers: a public https link to the file (JPG/PNG up to 5 MB, MP4 up to 16 MB, PDF up to 100 MB).

  • template.headerMediaFilenamestring

    Document headers: the file name customers see, like Invoice-1042.pdf.

  • template.locationobject

    Location headers: latitude and longitude, with optional name and address.

  • template.urlParamsstring[]

    Dynamic website buttons: the value added after the link, one per dynamic button, in button order.

  • template.quickReplyPayloadsstring[]

    Quick reply buttons: your own reference for each one, in button order, up to 256 characters. It comes back as buttonPayload in the message.received webhook when the customer taps it.

  • template.offerCodestring

    Copy offer code buttons: the code customers copy, up to 20 characters.

  • template.codestring

    Authentication templates: the one-time code. It fills the message and the Copy code or autofill button.

  • •Send either text or template, never both.
  • •If the 24-hour window is closed, a text send fails with 400. Send a template instead.
  • •Templates are not sent to contacts who replied STOP (400).
  • •A template send that leaves out a value the template needs, like a header image or a dynamic link, fails with 400 and says which field is missing. GET /templates lists what each template takes.
  • •Phone number, Call on WhatsApp, static website and form buttons need nothing at send time. See Sending templates for an example of every kind.
curl -X POST "https://www.chatpaat.com/api/v1/messages" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to":"+919876543210","template":{"name":"order_shipped","language":"en","bodyParams":["Priya","#CP2041"]}}'
Response · 201
{
  "id": "cm2k8z3ab0002ab12cd34ef56",
  "wamid": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgS",
  "status": "sent",
  "contactId": "cm2k8x1q40001ab12cd34ef56"
}

Get a message's status

GET/api/v1/messages/{id}

Check if a message was sent, delivered, read or failed. Look it up by the Chatpaat id or the WhatsApp wamid.

Path

  • idstringrequired

    The id or wamid returned when you sent it.

  • •status is one of pending, sent, delivered, read, failed (or received for a customer's message). When it failed, error has Meta's code and reason.
  • •To be told instead of asking, subscribe to the message.status webhook.
curl "https://www.chatpaat.com/api/v1/messages/cm2k8z3ab0002ab12cd34ef56" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "id": "cm2k8z3ab0002ab12cd34ef56",
  "wamid": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgS",
  "direction": "outbound",
  "type": "template",
  "text": "Hi Priya, your order #CP2041 has shipped!",
  "status": "read",
  "error": null,
  "createdAt": "2026-10-13T10:00:00.000Z",
  "sentAt": "2026-10-13T10:00:01.000Z",
  "deliveredAt": "2026-10-13T10:00:03.000Z",
  "readAt": "2026-10-13T10:02:40.000Z"
}

Contacts

Keep your customer list in sync with your own systems.

List contacts

GET/api/v1/contacts

List your contacts, newest first. Filter by phone number to find one person, or by tag.

Query

  • phonestring

    Only the contact with this phone number.

  • tagstring

    Only contacts with this tag.

  • limitnumber

    How many to return, 1 to 200. Default 50.

  • cursorstring

    The nextCursor from the previous page, to get the next page.

curl "https://www.chatpaat.com/api/v1/contacts?tag=vip&limit=50" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "data": [
    {
      "id": "cm2k8x1q40001ab12cd34ef56",
      "phone": "919876543210",
      "name": "Priya Sharma",
      "email": "priya@example.com",
      "tags": [
        "vip",
        "pune"
      ],
      "attributes": {
        "city": "Pune",
        "plan": "gold"
      },
      "optIn": "opted_in",
      "createdAt": "2026-10-13T09:30:00.000Z"
    }
  ],
  "nextCursor": null
}

Create or update a contact

POST/api/v1/contacts

Add a contact, or update it if the phone number already exists. New tags and attributes are merged with the ones it has, so it's safe to call every time a customer signs up or orders.

Body

  • phonestringrequired

    Phone number with country code.

  • namestring

    Their name, up to 120 characters.

  • emailstring

    Their email address.

  • tagsstring[]

    Tags to add. Stored in lowercase. Adding a tag can start a sequence.

  • attributesobject

    Custom fields as text, e.g. {"city": "Pune"}. Use them in templates and broadcasts.

  • optedInboolean

    true records that they agreed to get WhatsApp messages. Ignored if they replied STOP.

  • •Returns 201 for a new contact and 200 when an existing one was updated.
curl -X POST "https://www.chatpaat.com/api/v1/contacts" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+919876543210","name":"Priya Sharma","email":"priya@example.com","tags":["vip"],"attributes":{"city":"Pune"},"optedIn":true}'
Response · 201
{
  "id": "cm2k8x1q40001ab12cd34ef56",
  "phone": "919876543210",
  "name": "Priya Sharma",
  "email": "priya@example.com",
  "tags": [
    "vip",
    "pune"
  ],
  "attributes": {
    "city": "Pune",
    "plan": "gold"
  },
  "optIn": "opted_in",
  "createdAt": "2026-10-13T09:30:00.000Z"
}

Templates

See which approved templates you can send, and how many variables each needs.

List approved templates

GET/api/v1/templates

Every template Meta has approved, with every value it takes when you send it: header type, how many body and header values, which buttons need a value, and a ready-made exampleRequest for POST /messages.

  • •header is null, text, image, video, document or location.
  • •Each button's send names the POST /messages field that fills it, or is null when it needs nothing.
curl "https://www.chatpaat.com/api/v1/templates" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "data": [
    {
      "name": "order_ready",
      "language": "en",
      "category": "utility",
      "body": "Hi {{1}}, your order #{{2}} is ready. Download your files below.",
      "authentication": false,
      "header": "document",
      "headerParams": 0,
      "bodyParams": 2,
      "urlParams": 1,
      "quickReplies": 1,
      "offerCode": false,
      "buttons": [
        {
          "index": 0,
          "type": "URL",
          "text": "Download",
          "send": "urlParams"
        },
        {
          "index": 1,
          "type": "QUICK_REPLY",
          "text": "Need help",
          "send": "quickReplyPayloads"
        }
      ],
      "exampleRequest": {
        "to": "+919876543210",
        "template": {
          "name": "order_ready",
          "language": "en",
          "bodyParams": [
            "value 1",
            "value 2"
          ],
          "headerMediaUrl": "https://example.com/invoice.pdf",
          "headerMediaFilename": "Invoice.pdf",
          "urlParams": [
            "link-value-1"
          ],
          "quickReplyPayloads": [
            "reply-1"
          ]
        }
      }
    }
  ]
}

Sequences

Start a drip sequence for a contact, for example from your sign-up form.

List sequences

GET/api/v1/sequences

Your drip sequences, to find the id to enrol contacts into.

curl "https://www.chatpaat.com/api/v1/sequences" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "data": [
    {
      "id": "cm2ka1b2c0004ab12cd34ef56",
      "name": "Welcome series",
      "enabled": true,
      "trigger": "manual",
      "tag": null,
      "steps": 3
    }
  ]
}

Enrol a contact in a sequence

POST/api/v1/sequences/{id}/enroll

Start a sequence for one person, for example right after they sign up on your website. Creates the contact if needed.

Path

  • idstringrequired

    The sequence id from List sequences.

Body

  • phonestringrequired

    Phone number with country code.

  • namestring

    Their name, used if the contact is new.

  • •Returns 200 with alreadyEnrolled: true if they are already in it.
  • •Contacts who replied STOP can't be enrolled (400).
curl -X POST "https://www.chatpaat.com/api/v1/sequences/cm2ka1b2c0004ab12cd34ef56/enroll" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+919876543210","name":"Priya Sharma"}'
Response · 201
{
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "enrolled": true,
  "alreadyEnrolled": false
}

Deals

Add leads to your sales pipeline and move them between stages.

List deals

GET/api/v1/deals

Deals in your sales pipeline, newest first.

Query

  • statusstring

    open, won or lost.

  • contactIdstring

    Only this contact's deals.

  • limitnumber

    How many to return, 1 to 200. Default 50.

  • cursorstring

    The nextCursor from the previous page, to get the next page.

curl "https://www.chatpaat.com/api/v1/deals?status=open" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "data": [
    {
      "id": "cm2k9a7rt0003ab12cd34ef56",
      "title": "Wholesale order: 200 kurtas",
      "contactId": "cm2k8x1q40001ab12cd34ef56",
      "stage": "Quote sent",
      "status": "open",
      "value": 25000,
      "currency": "INR",
      "ownerId": null,
      "followUpAt": null,
      "lostReason": null,
      "createdAt": "2026-10-13T09:45:00.000Z",
      "closedAt": null
    }
  ],
  "nextCursor": null
}

Create a deal

POST/api/v1/deals

Add a deal to your pipeline, e.g. from your website's enquiry form. Give a contactId or a phone (the contact is created if needed).

Body

  • titlestringrequired

    What the deal is, up to 120 characters.

  • phonestring

    Phone number with country code. Required if there's no contactId.

  • contactIdstring

    An existing contact's id.

  • valuenumber

    Value in rupees. Default 0.

  • stagestring

    A stage name such as Quote sent. Default is your first stage.

  • notesstring

    Anything your team should know.

curl -X POST "https://www.chatpaat.com/api/v1/deals" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"phone":"+919876543210","title":"Wholesale order: 200 kurtas","value":25000,"stage":"Quote sent"}'
Response · 201
{
  "id": "cm2k9a7rt0003ab12cd34ef56",
  "title": "Wholesale order: 200 kurtas",
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "stage": "Quote sent",
  "status": "open",
  "value": 25000,
  "currency": "INR",
  "ownerId": null,
  "followUpAt": null,
  "lostReason": null,
  "createdAt": "2026-10-13T09:45:00.000Z",
  "closedAt": null
}

Get a deal

GET/api/v1/deals/{id}

One deal, with its stage and whether it's open, won or lost.

Path

  • idstringrequired

    The deal id.

curl "https://www.chatpaat.com/api/v1/deals/cm2k9a7rt0003ab12cd34ef56" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "id": "cm2k9a7rt0003ab12cd34ef56",
  "title": "Wholesale order: 200 kurtas",
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "stage": "Quote sent",
  "status": "open",
  "value": 25000,
  "currency": "INR",
  "ownerId": null,
  "followUpAt": null,
  "lostReason": null,
  "createdAt": "2026-10-13T09:45:00.000Z",
  "closedAt": null
}

Update or move a deal

PATCH/api/v1/deals/{id}

Change a deal or move it to another stage. Moving it to a Won or Lost stage closes it.

Path

  • idstringrequired

    The deal id.

Body

  • stagestring

    Stage name to move it to, e.g. Won.

  • titlestring

    New title.

  • valuenumber

    New value in rupees.

  • lostReasonstring

    Why it was lost, when moving it to a Lost stage.

curl -X PATCH "https://www.chatpaat.com/api/v1/deals/cm2k9a7rt0003ab12cd34ef56" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stage":"Won","value":27500}'
Response · 200
{
  "id": "cm2k9a7rt0003ab12cd34ef56",
  "title": "Wholesale order: 200 kurtas",
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "stage": "Won",
  "status": "won",
  "value": 27500,
  "currency": "INR",
  "ownerId": null,
  "followUpAt": null,
  "lostReason": null,
  "createdAt": "2026-10-13T09:45:00.000Z",
  "closedAt": "2026-10-14T11:20:00.000Z"
}

Products

Keep your catalog in step with your website, using your own product IDs. Changes reach your WhatsApp shop too.

List products

GET/api/v1/products

Your products, newest first.

Query

  • categorystring

    Only products in this category.

  • inStockboolean

    true or false.

  • limitnumber

    How many to return, 1 to 200. Default 50.

  • cursorstring

    The nextCursor from the previous page, to get the next page.

curl "https://www.chatpaat.com/api/v1/products?inStock=true" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "data": [
    {
      "id": "KK-500",
      "name": "Kaju katli (500 g)",
      "description": "Made fresh every morning with pure ghee.",
      "price": 600,
      "mrp": 700,
      "currency": "INR",
      "imageUrl": "https://sharmasweets.in/img/kaju-katli.jpg",
      "websiteUrl": "https://sharmasweets.in/products/kaju-katli",
      "category": "Sweets",
      "inStock": true,
      "whatsapp": {
        "inCatalog": true,
        "error": null
      },
      "createdAt": "2026-10-19T08:00:00.000Z",
      "updatedAt": "2026-10-19T08:00:00.000Z"
    }
  ],
  "nextCursor": null
}

Add a product

POST/api/v1/products

Add a product under your own product ID. Fails with 409 if that ID is already used; to create or replace in one call, use PUT /products/{id}.

Body

  • idstringrequired

    Your product ID, up to 100 characters. Use the one on your website so you can match them.

  • namestringrequired

    Up to 120 characters.

  • pricenumberrequired

    Selling price in rupees, at least 1.

  • mrpnumber | null

    Crossed-out price in rupees. Higher than price shows as a sale on WhatsApp.

  • descriptionstring

    Up to 1,000 characters.

  • imageUrlstring | null

    An https:// link to a JPG or PNG. WhatsApp only shows products with a photo.

  • websiteUrlstring | null

    The product's page on your website. Without one, WhatsApp links to a Chatpaat product page with an Order on WhatsApp button.

  • categorystring

    Up to 40 characters, e.g. Sweets.

  • inStockboolean

    Default true. Out-of-stock products show as unavailable on WhatsApp.

  • •With a WhatsApp catalog connected (Catalog page in the app), every change is sent to it straight away. whatsapp.error says why a product isn't in it, e.g. it has no photo. whatsapp is null when no catalog is connected.
  • •Your product ID is also the content ID in the WhatsApp catalog, so carts customers send match your products.
curl -X POST "https://www.chatpaat.com/api/v1/products" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"id":"KK-500","name":"Kaju katli (500 g)","price":600,"mrp":700,"description":"Made fresh every morning with pure ghee.","imageUrl":"https://sharmasweets.in/img/kaju-katli.jpg","websiteUrl":"https://sharmasweets.in/products/kaju-katli","category":"Sweets"}'
Response · 201
{
  "id": "KK-500",
  "name": "Kaju katli (500 g)",
  "description": "Made fresh every morning with pure ghee.",
  "price": 600,
  "mrp": 700,
  "currency": "INR",
  "imageUrl": "https://sharmasweets.in/img/kaju-katli.jpg",
  "websiteUrl": "https://sharmasweets.in/products/kaju-katli",
  "category": "Sweets",
  "inStock": true,
  "whatsapp": {
    "inCatalog": true,
    "error": null
  },
  "createdAt": "2026-10-19T08:00:00.000Z",
  "updatedAt": "2026-10-19T08:00:00.000Z"
}

Get a product

GET/api/v1/products/{id}

One product, by your product ID.

Path

  • idstringrequired

    Your own product ID (the SKU on your website), URL-encoded. Products added in the app without one use the id the API returns for them.

curl "https://www.chatpaat.com/api/v1/products/KK-500" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "id": "KK-500",
  "name": "Kaju katli (500 g)",
  "description": "Made fresh every morning with pure ghee.",
  "price": 600,
  "mrp": 700,
  "currency": "INR",
  "imageUrl": "https://sharmasweets.in/img/kaju-katli.jpg",
  "websiteUrl": "https://sharmasweets.in/products/kaju-katli",
  "category": "Sweets",
  "inStock": true,
  "whatsapp": {
    "inCatalog": true,
    "error": null
  },
  "createdAt": "2026-10-19T08:00:00.000Z",
  "updatedAt": "2026-10-19T08:00:00.000Z"
}

Create or replace a product

PUT/api/v1/products/{id}

Creates the product if your ID is new (201), otherwise replaces it (200). Send the whole product: optional fields you leave out are cleared. The easiest way to sync your website's catalog.

Path

  • idstringrequired

    Your own product ID (the SKU on your website), URL-encoded. Products added in the app without one use the id the API returns for them.

Body

  • namestringrequired

    Up to 120 characters.

  • pricenumberrequired

    Selling price in rupees, at least 1.

  • mrpnumber | null

    Crossed-out price in rupees. Higher than price shows as a sale on WhatsApp.

  • descriptionstring

    Up to 1,000 characters.

  • imageUrlstring | null

    An https:// link to a JPG or PNG. WhatsApp only shows products with a photo.

  • websiteUrlstring | null

    The product's page on your website. Without one, WhatsApp links to a Chatpaat product page with an Order on WhatsApp button.

  • categorystring

    Up to 40 characters, e.g. Sweets.

  • inStockboolean

    Default true. Out-of-stock products show as unavailable on WhatsApp.

  • •With a WhatsApp catalog connected (Catalog page in the app), every change is sent to it straight away. whatsapp.error says why a product isn't in it, e.g. it has no photo. whatsapp is null when no catalog is connected.
  • •Your product ID is also the content ID in the WhatsApp catalog, so carts customers send match your products.
curl -X PUT "https://www.chatpaat.com/api/v1/products/KK-500" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Kaju katli (500 g)","price":600,"mrp":700,"description":"Made fresh every morning with pure ghee.","imageUrl":"https://sharmasweets.in/img/kaju-katli.jpg","websiteUrl":"https://sharmasweets.in/products/kaju-katli","category":"Sweets"}'
Response · 200
{
  "id": "KK-500",
  "name": "Kaju katli (500 g)",
  "description": "Made fresh every morning with pure ghee.",
  "price": 600,
  "mrp": 700,
  "currency": "INR",
  "imageUrl": "https://sharmasweets.in/img/kaju-katli.jpg",
  "websiteUrl": "https://sharmasweets.in/products/kaju-katli",
  "category": "Sweets",
  "inStock": true,
  "whatsapp": {
    "inCatalog": true,
    "error": null
  },
  "createdAt": "2026-10-19T08:00:00.000Z",
  "updatedAt": "2026-10-19T08:00:00.000Z"
}

Update a product

PATCH/api/v1/products/{id}

Change some fields, e.g. the price or stock. Fields you leave out stay as they are.

Path

  • idstringrequired

    Your own product ID (the SKU on your website), URL-encoded. Products added in the app without one use the id the API returns for them.

Body

  • namestring

    Up to 120 characters.

  • pricenumber

    Selling price in rupees, at least 1.

  • mrpnumber | null

    Crossed-out price in rupees. Higher than price shows as a sale on WhatsApp.

  • descriptionstring

    Up to 1,000 characters.

  • imageUrlstring | null

    An https:// link to a JPG or PNG. WhatsApp only shows products with a photo.

  • websiteUrlstring | null

    The product's page on your website. Without one, WhatsApp links to a Chatpaat product page with an Order on WhatsApp button.

  • categorystring

    Up to 40 characters, e.g. Sweets.

  • inStockboolean

    Out-of-stock products show as unavailable on WhatsApp.

curl -X PATCH "https://www.chatpaat.com/api/v1/products/KK-500" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"price":650,"inStock":false}'
Response · 200
{
  "id": "KK-500",
  "name": "Kaju katli (500 g)",
  "description": "Made fresh every morning with pure ghee.",
  "price": 650,
  "mrp": 700,
  "currency": "INR",
  "imageUrl": "https://sharmasweets.in/img/kaju-katli.jpg",
  "websiteUrl": "https://sharmasweets.in/products/kaju-katli",
  "category": "Sweets",
  "inStock": false,
  "whatsapp": {
    "inCatalog": true,
    "error": null
  },
  "createdAt": "2026-10-19T08:00:00.000Z",
  "updatedAt": "2026-10-19T10:30:00.000Z"
}

Delete a product

DELETE/api/v1/products/{id}

Deletes the product and takes it off your WhatsApp catalog. Past orders keep their own copy of its name and price.

Path

  • idstringrequired

    Your own product ID (the SKU on your website), URL-encoded. Products added in the app without one use the id the API returns for them.

curl -X DELETE "https://www.chatpaat.com/api/v1/products/KK-500" \
  -H "Authorization: Bearer $CHATPAAT_API_KEY"
Response · 200
{
  "id": "KK-500",
  "deleted": true
}

Sending templates

Every template is sent with POST /api/v1/messages and a template object. What goes in it depends on the template: its body variables, its header (text, image, video, document or location) and its buttons. Call GET /api/v1/templates to see what each approved template takes, with a ready-made exampleRequest you can copy.

Template hasSend
{{1}}, {{2}}… in the bodybodyParams, one value each, in order
A text header with {{1}}headerParams with one value
An image, video or document headerheaderMediaUrl (and headerMediaFilename for documents)
A location headerlocation with latitude and longitude
A website button ending in {{1}}urlParams, one per dynamic button
Quick reply buttonsquickReplyPayloads (optional, to know which tap was which)
A Copy offer code buttonofferCode
Authentication (one-time code)code
Phone, Call on WhatsApp, static website or form buttonsNothing

Body variables

The body has {{1}}, {{2}}… such as "Hi {{1}}, your order {{2}} has shipped."

  • •Send one value per variable, in number order. Values can't contain new lines, tabs or more than four spaces in a row.
{
  "to": "+919876543210",
  "template": {
    "name": "order_shipped",
    "language": "en",
    "bodyParams": [
      "Priya",
      "#CP2041"
    ]
  }
}

Text header with a variable

The header is text with {{1}}, such as "Order {{1}} is on its way".

  • •A text header has at most one variable, so headerParams has at most one value. A header without a variable needs nothing.
{
  "to": "+919876543210",
  "template": {
    "name": "order_on_way",
    "language": "en",
    "headerParams": [
      "#CP2041"
    ],
    "bodyParams": [
      "Priya"
    ]
  }
}

Image or video header

The header is an image (JPG or PNG) or a video (MP4).

  • •The sample you uploaded when creating the template is only for Meta's review. Each send must include its own file in headerMediaUrl.
  • •The link must be public https that WhatsApp can download: images up to 5 MB, videos up to 16 MB.
{
  "to": "+919876543210",
  "template": {
    "name": "diwali_sale",
    "language": "en",
    "headerMediaUrl": "https://cdn.example.com/diwali-banner.jpg",
    "bodyParams": [
      "Priya"
    ]
  }
}

Document header (send a file)

The header is a document, such as an invoice, ticket or eBook PDF.

  • •PDF up to 100 MB. headerMediaFilename is what customers see; without it WhatsApp shows a generic name.
  • •Signed links work as long as they are still valid when WhatsApp fetches the file, a few seconds after the send.
{
  "to": "+919876543210",
  "template": {
    "name": "invoice_ready",
    "language": "en",
    "headerMediaUrl": "https://files.example.com/invoices/1042.pdf",
    "headerMediaFilename": "Invoice-1042.pdf",
    "bodyParams": [
      "Priya",
      "1042"
    ]
  }
}

Location header

The header is a location, such as a store or event venue.

  • •latitude and longitude are required; name and address show under the map.
{
  "to": "+919876543210",
  "template": {
    "name": "visit_store",
    "language": "en",
    "location": {
      "latitude": 18.5204,
      "longitude": 73.8567,
      "name": "Chatpaat Store",
      "address": "FC Road, Pune"
    },
    "bodyParams": [
      "Priya"
    ]
  }
}

Website button with a variable

A Visit website button's link ends in {{1}}, such as https://example.com/orders/{{1}}.

  • •The value goes after the link exactly as sent, so CP2041 opens https://example.com/orders/CP2041. Percent-encode anything that isn't a plain letter or number.
  • •With two dynamic website buttons, send two values in button order. Static website buttons need nothing.
{
  "to": "+919876543210",
  "template": {
    "name": "track_order",
    "language": "en",
    "bodyParams": [
      "Priya"
    ],
    "urlParams": [
      "CP2041"
    ]
  }
}

Quick reply buttons

The template has Custom (quick reply) buttons such as "Confirm" and "Cancel".

  • •Optional. When the customer taps a button, the message.received webhook has its label in text and your payload in buttonPayload, so you know which order it was about.
  • •Without payloads the tap still arrives, with only the label.
{
  "to": "+919876543210",
  "template": {
    "name": "cod_confirm",
    "language": "en",
    "bodyParams": [
      "Priya",
      "₹1,499"
    ],
    "quickReplyPayloads": [
      "confirm:CP2041",
      "cancel:CP2041"
    ]
  }
}

Copy offer code button

A marketing template has a Copy offer code button.

  • •Letters and numbers, up to 20 characters. Customers tap the button to copy it.
{
  "to": "+919876543210",
  "template": {
    "name": "festive_offer",
    "language": "en",
    "bodyParams": [
      "Priya"
    ],
    "offerCode": "DIWALI20"
  }
}

Authentication (one-time code)

An authentication template, such as login or password reset codes, with a Copy code, one-tap or zero-tap button.

  • •Send only code. Meta writes the message ("482913 is your verification code.") and the same code goes on the button. bodyParams: ["482913"] works too.
  • •Codes are up to 15 characters. Meta doesn't allow links, media or emojis in authentication templates.
  • •WhatsApp has no official way to check if a number is on WhatsApp before you send. Send the code and watch for the result: if the number can't get WhatsApp messages, the message.status webhook (and GET /messages/{id}) reports failed with error code 131026, usually within seconds. Meta only charges for delivered messages, so a failed attempt costs nothing.
  • •For an SMS fallback, send the SMS when the status is failed, or when it hasn't reached delivered after about 15 seconds (the phone may be off, and webhooks aren't retried). On the login screen, say the code is going to WhatsApp and offer "Send by SMS instead".
{
  "to": "+919876543210",
  "template": {
    "name": "login_code",
    "language": "en_US",
    "code": "482913"
  }
}

Several at once

A template with a document header, body variables, a dynamic link and a quick reply. Combine the fields; each one fills its own part.

  • •Phone number, Call on WhatsApp and form (flow) buttons never need a value: Chatpaat adds what WhatsApp needs.
  • •Not sure what a template takes? GET /templates returns an exampleRequest for each one.
{
  "to": "+919876543210",
  "template": {
    "name": "order_ready",
    "language": "en",
    "headerMediaUrl": "https://files.example.com/orders/1042/ebook.pdf",
    "headerMediaFilename": "Your-eBook.pdf",
    "bodyParams": [
      "Priya",
      "1042"
    ],
    "urlParams": [
      "1042"
    ],
    "quickReplyPayloads": [
      "help:1042"
    ]
  }
}

Webhooks

Webhooks tell your server when something happens, so you don't have to keep asking. Add an https URL under Developers in the app and choose the events you want. Chatpaat sends each one as a POST with this body:

Body
{
  "event": "message.received",
  "createdAt": "2026-10-13T12:05:00.000Z",
  "data": {
    "…": "see the events below"
  }
}

Reply with any 2xx status within 5 seconds; do slow work in the background. Each event is sent once, and the last result is shown next to the endpoint under Developers.

Verify signatures

Every request has an X-Chatpaat-Signature header: sha256= and the HMAC-SHA256 of the raw body, keyed with the endpoint's signing secret (whsec_…). Check it before trusting the request. X-Chatpaat-Event carries the event name.

import crypto from "node:crypto";

// Use the raw request body, exactly as received, before JSON.parse.
export function isFromChatpaat(rawBody, signatureHeader) {
  const expected = "sha256=" + crypto
    .createHmac("sha256", process.env.CHATPAAT_WEBHOOK_SECRET)
    .update(rawBody)
    .digest("hex");
  const given = signatureHeader || "";
  return given.length === expected.length &&
    crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected));
}

Events

message.receivedA customer sends you a message on WhatsApp, Instagram or Messenger. A tap on a template's quick reply arrives here too, with `buttonPayload` set to the payload you sent with it.▾
data
{
  "messageId": "cm2kc3d4e0007ab12cd34ef56",
  "wamid": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAEhgU",
  "conversationId": "cm2kc0cnv0008ab12cd34ef56",
  "contact": {
    "id": "cm2k8x1q40001ab12cd34ef56",
    "phone": "919876543210",
    "name": "Priya Sharma"
  },
  "type": "text",
  "text": "Is the blue kurta available in L?",
  "receivedAt": "2026-10-13T12:05:00.000Z"
}
message.statusA message you sent is delivered, read or fails. A failed message also has `error` with Meta's code and reason; 131026 means the number can't get WhatsApp messages (not on WhatsApp, or an outdated app).▾
data
{
  "messageId": "cm2k8z3ab0002ab12cd34ef56",
  "wamid": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgS",
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "status": "delivered",
  "at": "2026-10-13T10:00:03.000Z"
}
contact.opted_outA customer replies STOP. Stop sending them marketing.▾
data
{
  "contact": {
    "id": "cm2k8x1q40001ab12cd34ef56",
    "phone": "919876543210"
  }
}
order.createdAn order is created in the inbox or from a WhatsApp cart. Amounts are in paise.▾
data
{
  "id": "cm2kb2c3d0005ab12cd34ef56",
  "number": 1042,
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "status": "pending",
  "items": [
    {
      "productId": "cm2kb0prd0006ab12cd34ef56",
      "name": "Cotton kurta (M)",
      "price": 89900,
      "quantity": 2
    }
  ],
  "subtotal": 179800,
  "delivery": 0,
  "total": 179800,
  "currency": "INR",
  "note": null,
  "source": "inbox",
  "payUrl": "https://www.chatpaat.com/pay/Xk29dLq",
  "paidAt": null,
  "createdAt": "2026-10-13T12:00:00.000Z"
}
order.paidAn order is paid.▾
data
{
  "id": "cm2kb2c3d0005ab12cd34ef56",
  "number": 1042,
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "status": "paid",
  "items": [
    {
      "productId": "cm2kb0prd0006ab12cd34ef56",
      "name": "Cotton kurta (M)",
      "price": 89900,
      "quantity": 2
    }
  ],
  "subtotal": 179800,
  "delivery": 0,
  "total": 179800,
  "currency": "INR",
  "note": null,
  "source": "inbox",
  "payUrl": "https://www.chatpaat.com/pay/Xk29dLq",
  "paidAt": "2026-10-13T12:09:00.000Z",
  "createdAt": "2026-10-13T12:00:00.000Z"
}
order.statusAn order is shipped, delivered or cancelled.▾
data
{
  "id": "cm2kb2c3d0005ab12cd34ef56",
  "number": 1042,
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "status": "shipped",
  "items": [
    {
      "productId": "cm2kb0prd0006ab12cd34ef56",
      "name": "Cotton kurta (M)",
      "price": 89900,
      "quantity": 2
    }
  ],
  "subtotal": 179800,
  "delivery": 0,
  "total": 179800,
  "currency": "INR",
  "note": null,
  "source": "inbox",
  "payUrl": "https://www.chatpaat.com/pay/Xk29dLq",
  "paidAt": "2026-10-13T12:09:00.000Z",
  "createdAt": "2026-10-13T12:00:00.000Z"
}
deal.createdA deal is added to your pipeline.▾
data
{
  "id": "cm2k9a7rt0003ab12cd34ef56",
  "title": "Wholesale order: 200 kurtas",
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "stage": "Quote sent",
  "status": "open",
  "value": 25000,
  "currency": "INR",
  "ownerId": null,
  "followUpAt": null,
  "lostReason": null,
  "createdAt": "2026-10-13T09:45:00.000Z",
  "closedAt": null
}
deal.stage_changedA deal moves stage, is won or is lost.▾
data
{
  "id": "cm2k9a7rt0003ab12cd34ef56",
  "title": "Wholesale order: 200 kurtas",
  "contactId": "cm2k8x1q40001ab12cd34ef56",
  "stage": "Won",
  "status": "won",
  "value": 25000,
  "currency": "INR",
  "ownerId": null,
  "followUpAt": null,
  "lostReason": null,
  "createdAt": "2026-10-13T09:45:00.000Z",
  "closedAt": "2026-10-14T11:20:00.000Z",
  "previousStage": "Quote sent"
}
form.submittedA customer submits a WhatsApp form.▾
data
{
  "responseId": "cm2kd4e5f0009ab12cd34ef56",
  "formId": "cm2kd0frm0010ab12cd34ef56",
  "form": "Book a demo",
  "contact": {
    "id": "cm2k8x1q40001ab12cd34ef56",
    "phone": "919876543210",
    "name": "Priya Sharma"
  },
  "answers": {
    "city": "Pune",
    "preferred_time": "Morning"
  },
  "dealId": null,
  "submittedAt": "2026-10-13T13:00:00.000Z"
}
call.endedA WhatsApp call ends, is missed or declined.▾
data
{
  "callId": "cm2ke5f6g0011ab12cd34ef56",
  "direction": "inbound",
  "status": "ended",
  "durationSec": 184,
  "contact": {
    "id": "cm2k8x1q40001ab12cd34ef56",
    "phone": "919876543210",
    "name": "Priya Sharma"
  },
  "agentId": "cm2ke0usr0012ab12cd34ef56",
  "startedAt": "2026-10-13T14:00:00.000Z",
  "endedAt": "2026-10-13T14:03:04.000Z"
}

Stuck on something?

Tell us what you're building and we'll help you wire it up.