Skip to main content
POST
/
instances
/
{instanceId}
/
token
/
{token}
/
send-text
Chat with Meta AI
curl --request POST \
  --url https://api.z-api.io/instances/{instanceId}/token/{token}/send-text \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone": "<string>",
  "message": "<string>"
}
'

Overview

This method enables direct interaction with Meta AI on WhatsApp through Z-API, facilitating sending text messages to get automated and contextual responses. You can chat with Meta AI in a private chat using the number 13135550002 or include it in groups using the group ID.
Currently, Meta AI on Z-API only supports text messages. This means audio, documents, images, and other multimedia files are not compatible with this integration.
This feature is only available for personal WhatsApp accounts.

Attributes

instanceId
string
required
Your instance ID. Available in the Z-API panel under Instances.
token
string
required
Your Z-API instance token.

Required

phone
string
required
Use 13135550002 for private chat or the group ID for group conversations
message
string
required
Message text

Optional

delayMessage
number
Delay added to the message. You can choose between a range of 1 to 15 sec
delayTyping
number
Delay with “Typing…” status. Range of 1 to 15 sec
mentioned
array
Include 13135550002 when mentioning Meta AI in groups

Request Body

Private chat:
{
  "phone": "13135550002",
  "message": "Hello, Meta AI! I would like to know about..."
}
In a group:
{
  "phone": "5511999999999-group",
  "message": "@13135550002 Hello, Meta AI! I would like to know about...",
  "mentioned": [13135550002]
}

Response

200

{
  "zaapId": "3999984263738042930CD6ECDE9VDWSA",
  "messageId": "D241XXXX732339502B68",
  "id": "D241XXXX732339502B68"
}

405

Make sure you are correctly sending the method specification, that is, verify that you sent POST or GET as specified at the beginning of this topic.

415

If you receive a 415 error, make sure to add the “Content-Type” header to your request, which in most cases is “application/json”.