Skip to main content
POST
/
send-text
Send plain text
curl --request POST \
  --url https://api.z-api.io/send-text \
  --header 'Client-Token: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "phone": "<string>",
  "message": "<string>"
}
'
{
  "zaapId": "<string>",
  "messageId": "<string>",
  "id": "<string>"
}

Overview

With this method you can send plain text messages, and enhance them using text formatting and emojis. If you don’t know how to do it yet, follow the links below:
  • To learn how to format text in WhatsApp click here
  • You can also use line breaks in your messages. Depending on your platform and programming language, use one of the following:
    • \n
    • \r
    • \r\n
    • %0a
    Check which one works best for your case. If you find a new way to break lines, please let us know :)
  • You can also use emojis in your messages. Need some? Use this link.
About emojisAn emoji is a regular ASCII character — just like any font. You can copy and paste any emoji directly into your text! Feel free to use this one 🤪 if you want.

Attributes

Required

instanceId
string
required
Your instance ID. Available in the Z-API panel under Instances.
token
string
required
Your Z-API instance token.
phone
string
required
Recipient’s phone number (or group ID) in the format CountryCode AreaCode NUMBER. Ex: 5511999999999. IMPORTANT Send numbers only, no formatting or mask.
message
string
required
Text to be sent

Optional

delayMessage
number
Adds a delay before sending the message. You can set a range of 1–15 seconds. (Ex.: “delayMessage”: 5). Default delay if not set: 1–3 sec.
delayTyping
number
Sets how many seconds the “Typing…” status will show before sending. Range: 1–15 sec. (Ex.: “delayTyping”: 5). Default: 0.
editMessageId
string
Allows editing a previously sent WhatsApp message. Use the message ID and new content in the JSON. Webhook must be configured before editing.

Request Body

{
  "phone": "5511999999999",
  "message": "Welcome to *Z-API*"
}

Response

200

zaapId
string
Message ID in Z-API
messageId
string
Message ID in WhatsApp
id
string
Added for Zapier compatibility, it has the same value as messageId
{
  "zaapId": "3999984263738042930CD6ECDE9VDWSA",
  "messageId": "D241XXXX732339502B68",
  "id": "D241XXXX732339502B68"
}

405

Make sure you are sending the correct HTTP method — verify that you are using POST or GET as specified at the top of this page.

415

If you receive a 415 error, make sure to add Content-Type: application/json to your request headers.

Webhook Response

Link to the webhook response (on receive) Webhook