POST
/
api
/
hooks
/
whatsapp
curl --request POST \
  --url https://copilotz.com/api/hooks/whatsapp \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "extId": "275165175681181",
  "user": {
    "name": "Vinicius Santos",
    "phone": "5511972186303",
    "email": "vinicius@axion.company",
    "ctx": {}
  },
  "thread": {
    "extId": "5511972186303",
    "ctx": {}
  },
  "input": "<string>",
  "audio": "<string>",
  "answer": {
    "message": "Bem vindo à Pássaro Marron!\n\nVocê gostaria de fazer um cadastro conosco para ganhar um cupom de até 20% de desconto na próxima compra?",
    "functions": [
      {
        "name": "callback",
        "args": {
          "template": "signup_discount_coupon",
          "variables": [
            "Pássaro Marron",
            "até 20% de ",
            "na próxima compra"
          ],
          "language": "pt_BR"
        }
      }
    ],
    "submit": {}
  }
}'
{
  "extId": "275165175681181",
  "user": {
    "name": "Vinicius Santos",
    "phone": "5511972186303",
    "email": "vinicius@axion.company",
    "ctx": {}
  },
  "thread": {
    "extId": "5511972186303",
    "ctx": {}
  },
  "input": "<string>",
  "audio": "<string>",
  "answer": {
    "message": "Bem vindo à Pássaro Marron!\n\nVocê gostaria de fazer um cadastro conosco para ganhar um cupom de até 20% de desconto na próxima compra?",
    "functions": [
      {
        "name": "callback",
        "args": {
          "template": "signup_discount_coupon",
          "variables": [
            "Pássaro Marron",
            "até 20% de ",
            "na próxima compra"
          ],
          "language": "pt_BR"
        }
      }
    ],
    "submit": {}
  }
}

Authorizations

Authorization
string
header
required

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

Body

application/json

Request payload for creating a webhook to send WhatsApp marketing templated messages.

extId
string
required

External ID for matching with external systems.

Example:

"275165175681181"

user
object
required

User details associated with the message.

thread
object
required

Thread details for the message.

answer
object
required

Answer details including the message and functions to execute.

input
string

Input message

audio
string

Blob of audio message

Response

200 - application/json
Successful response

Request payload for creating a webhook to send WhatsApp marketing templated messages.

extId
string
required

External ID for matching with external systems.

Example:

"275165175681181"

user
object
required

User details associated with the message.

thread
object
required

Thread details for the message.

answer
object
required

Answer details including the message and functions to execute.

input
string

Input message

audio
string

Blob of audio message