POST
/
zapi
/
{instanceId}
/
{contactPhone}
/
message

Example JS Code to Send WhatsApp Message

const apiUrl = 'https://api.chatvolt.ai';
const apiKey = 'XXX';
const zApiInstanceId = 'XXX';
const destinationWhatsAppNumber = 'XXX';

const res = await fetch(`${apiUrl}/zapi/${zApiInstanceId}/${destinationWhatsAppNumber}/message`, {
  method: 'POST',
  body: JSON.stringify({
    message: 'Your message here',
    attachments: [],
  }),
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${apiKey}`,
  },
});

Authorizations

Authorization
string
headerrequired

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

Path Parameters

instanceId
string
required

Z-API instance ID (externalId of the ServiceProvider of type 'zapi').

contactPhone
string
required

Recipient's WhatsApp number.

Body

application/json
message
string

Textual content of the message.

attachments
object[]

Optional list of attachments to be sent.

Response

200 - application/json
id
string
text
string
html
string | null
from
enum<string>
Available options:
human,
agent
conversationId
string
sources
object[] | null
usage
object | null
externalId
string | null
userId
string | null
contactId
string | null
visitorId
string | null
agentId
string | null
metadata
object | null
inputId
string | null
eval
enum<string> | null
Available options:
good,
bad
read
boolean
agentModel
string | null
usageCredits
number | null
createdAt
string
updatedAt
string