Reference

Send a message

Sends one template message to one WhatsApp number, using an API campaign. Send one request for each person.

POSThttps://qmessage.gatiq.in/api/v1/send
HeaderValue
AuthorizationBearer YOUR_API_KEY
Content-Typeapplication/json

The key can also be sent as X-Api-Key or as apiKey in the body. See API keys.

Example

curl -X POST https://qmessage.gatiq.in/api/v1/send \
  -H "Authorization: Bearer $QMESSAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "campaignName": "order_update",
    "destination": "919876543210",
    "userName": "Priya Sharma",
    "templateParams": [
      "Priya",
      "#10234",
      "Friday"
    ],
    "source": "Website order",
    "tags": [
      "customer"
    ],
    "attributes": {
      "city": "Jaipur"
    }
  }'

Main fields

campaignNamestringRequired

The name of a live API campaign in this project. Capital letters don’t matter. Also accepted as campaign.

destinationstringRequired

The customer’s WhatsApp number with the country code, for example 919876543210 or +91 98765 43210. Spaces, dashes and a leading + or 00 are fine.

A 10-digit number without a country code is taken as an Indian number. Numbers from other countries must include their country code. Also accepted as to.

templateParamsstring[]If the template has values

Values for the template’s {{1}}, {{2}}… in the message text, in order. Send exactly as many as the template has, and none may be empty. Numbers are fine too. Also accepted as values.

Each value can be up to 1,024 characters. Line breaks and tabs are turned into spaces, because WhatsApp doesn’t allow them inside values.

paramsFallbackValueobject

Values to use when one in templateParams is empty or missing, for example when your system doesn’t know the customer’s name. Give them by placeholder or position: { "1": "there" } fills {{1}}.

If no key matches and you send exactly one fallback per value, they are used in order. So AiSensy-style { "FirstName": "there" } works for a template with one value.

userNamestring

The customer’s name, up to 80 characters. Saved on the contact if they don’t have a name in QMessage yet. Also accepted as name.

Contact fields

These are saved on the customer’s contact in QMessage. See Contacts and opt-out.

tagsstring[]

Tags to add to the contact, for example ["customer", "diwali-sale"]. Up to 20 tags, each up to 30 characters. Tags are saved in small letters and added to the contact’s existing tags. New tags are created for you.

attributesobject

Custom fields to save on the contact, for example { "city": "Jaipur", "plan": "Gold" }. Names up to 40 characters, values up to 500. A field with the same name is replaced; other fields stay. You can use these fields in normal campaigns later.

sourcestring

Where the lead came from, for example Website lead or Facebook form. Saved as the contact field source. If attributes also has source, that one is used.

Fields for special templates

Send these only if the template needs them. Examples by template shows each one in a full request.

headerParamsstring[]

The value for a {{1}} in a text header, up to 60 characters. One value.

media{ url, filename? }

The image, video or PDF at the top of the message. url must be a public link that starts with https://. WhatsApp downloads the file from it. filename is the name a PDF shows on the customer’s phone. Leave it out to use the API campaign’s default file.

location{ latitude, longitude, name?, address? }

For templates with a location at the top. Latitude from -90 to 90, longitude from -180 to 180. Leave it out to use the API campaign’s default location.

buttonParamsobject

The end of the link for a website button whose link ends in {{1}}, by button position (starting from 0). For example { "0": "A1234" } turns https://shop.com/track/{{1}} into https://shop.com/track/A1234.

buttonsobject[]

The same values in WhatsApp’s own format, as AiSensy accepts them: { "type": "button", "sub_type": "url", "index": 0, "parameters": [{ "type": "text", "text": "A1234" }] }. A copy_code button with coupon_code works too. If both are sent, buttonParams and couponCode win.

couponCodestring

The code for a “Copy offer code” button, up to 15 characters.

offerExpiresAtnumber | string

When a limited-time offer ends: milliseconds since 1970 (for example 1767225599000) or a date and time with a time zone (for example 2026-12-31T23:59:59+05:30). Must be in the future.

otpstring

The one-time code for an authentication template, up to 15 characters and no spaces. You can also send it as code or as the first value in templateParams.

cardsobject[]

For carousel templates: one entry per card, in order. Each card has media.url (its image or video), templateParams (values for the card’s text, up to 160 characters each) and buttonParams (link endings for the card’s website buttons).

Send every card, in order. If you leave out a card’s media.url, the API campaign’s default file for that card is used. When the cards have no values and the campaign has default files, you can leave out cards completely.

carouselCardsobject[]

The same as cards, in WhatsApp’s own format as AiSensy accepts it: card_index and components with header, body and button parts. Card files must be https links, not media ids. If both are sent, cards wins.

Testing

dryRunboolean

Set to true to check the request without sending anything. QMessage runs every check and returns the final message, so you can see exactly what the customer would get. Nothing is sent and nothing is charged.

200 OK · dryRun
{
  "success": true,
  "dryRun": true,
  "to": "919876543210",
  "template": {
    "name": "order_update",
    "language": "en",
    "category": "UTILITY",
    "type": "standard"
  },
  "message": {
    "header": null,
    "body": "Hi Priya, your order #10234 will arrive on Friday.",
    "footer": "Reply STOP to opt out"
  },
  "note": "Checked only: nothing was sent."
}

Response

When WhatsApp accepts the message:

200 OK
{
  "success": true,
  "messageId": "6f1c2a9e-0d3b-4c71-9a55-2b7d8e4f1c20",
  "waMessageId": "wamid.HBgMOTE5ODc2NTQzMjEwFQIAERgSQ0Y3",
  "contactId": "c2b1f0e4-7a8d-4e2b-b1c3-5d6e7f8a9b0c",
  "status": "sent"
}
FieldMeaning
messageIdQMessage’s id for the message. Search for it in the API campaign’s messages.
waMessageIdWhatsApp’s id for the message.
contactIdThe customer’s contact in QMessage.
statusAlways sent here: WhatsApp accepted it. Delivered and read follow in QMessage.

Anything else returns success: false with an error that says what to fix. See Responses and errors.

Note

Fields QMessage doesn’t know are ignored, so a request written for another platform won’t fail because of an extra field.
QMessage is a product of GatiQ Platforms LLP. Questions about the API? Write to qmessage@gatiq.in.