Skip to main content
POST
/
whatsapp
/
send-template
cURL
curl --request POST \
  --url https://api.open.cx/whatsapp/send-template \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "template_id": "<string>",
  "phone_number_id": "<string>",
  "variables": [
    "<string>"
  ],
  "contact": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  },
  "session_id": "<string>"
}'
{
  "whatsapp_message_id": "<string>",
  "opencx_message_id": "<string>",
  "opencx_session_id": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
template_id
string
required

The ID of the WhatsApp template to send

phone_number_id
string
required

The ID of the WhatsApp number to send the template from

variables
string[]
required

A list of values to be used for the variables in the template. Values will be taken in order; HEADER then BODY then BUTTONS. This works whether the template's parameters are NAMED or POSITIONAL.

contact
object
required

A contact identifier; either an ID, email, or phone number. If no contact is found, a new contact will be created (if a phone number was provided).

  • ID
  • Email
  • Phone
session_id
string

Optional OpenCX session ID to send the template to. If not provided, a new session will be created. If provided ID is related to another WhatsApp phone number or is not a WhatsApp session or is related to a different contact, a new WhatsApp session will be created.

Response

whatsapp_message_id
string
required

The message ID returned by WhatsApp

opencx_message_id
string
required

The message ID in our system

opencx_session_id
string
required

The session ID in our system

I