Skip to main content
POST
/
whatsapp
/
send-template
Send an approved WhatsApp template to a number. Customer and conversation will be created if not already existing.
curl --request POST \
  --url https://1-some-client.some-server.healvi-chat/third-party/v1/whatsapp/send-template \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "phone_number": 4915224367929,
  "customer_name": "<string>",
  "template_name": "<any>",
  "template_components": [
    {}
  ],
  "agent_id": 123
}'
{
  "data": {
    "id": 123,
    "conversation_id": 123,
    "from": "system",
    "source": "user",
    "user_id": 123,
    "contents": [
      {
        "type": "text",
        "content": "<string>"
      }
    ],
    "status": "created",
    "agent_reaction": "<string>",
    "customer_reaction": "<string>",
    "sent_at": "2023-01-01T12:00:00Z",
    "reference": {},
    "latest_error": {
      "id": 123,
      "message_id": 123,
      "type": "status-update",
      "original_message": "<string>",
      "created_at": "2023-01-01T12:00:00Z"
    },
    "whatsapp_campaign": {
      "id": 123,
      "name": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json
phone_number
string

Number of WhatsApp user to send template to. Must be in E.164 format.

Example:

4915224367929

customer_name
string

Name of WhatsApp user. Customer will be created with that name if not already exists.

template_name
any

Name of template to send.

template_components
object[]

Array of objects describing how to fill placeholders within the specified template. If there are no placeholders, set this to an empty array. Format is defined by WhatsApp. See components under https://developers.facebook.com/docs/whatsapp/cloud-api/guides/send-message-templates

agent_id
integer | null

Optional ID of WhatsApp agent to use for sending the message. Defaults to first available agent for that template.

Response

200 - application/json

Success

data
object

A message within a conversation.