Skip to main content

Send Event

Method#

/send-event#

POST https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/send-event

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

In this method, you can send messages of type Event.

image


Attributes#

Required#

AttributesTypeDescription
phonestringRecipient's phone number (or group ID for group messages) in the format CC DDD NUMBER. IMPORTANT Send only numbers, without formatting or masks.
eventEventEvent data

Event#

AttributesTypeDescription
namestringEvent name
descriptionstring (optional)Event description
dateTimestringEvent date and time (without timezone)
locationLocation (optional)Event location
callLinkTypestring (voice/video) (optional)Event call type (voice or video)
canceledbooleanDefines if the event is canceled

Request Body#

{
"phone": "120363019502650977-group",
"event": {
"name": "Event Name",
"description": "Event Description",
"dateTime": "2024-04-29T09:30:53.309Z",
"location": {
"name": "Location Name"
},
"callLinkType": "voice | video",
"canceled": false
}
}

Response#

200#

AttributesTypeDescription
zaapIdstringZ-api id
messageIdstringWhatsApp id
idstringAdded for compatibility with Zapier, it has the same value as messageId

Example

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

405#

In this case, make sure you are correctly sending the method specification, meaning check if you sent the 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" of the object you are sending in the request headers, mostly "application/json".


Webhook Response#

Link to the webhook response (upon receiving)

Webhook


Code#