curl --request POST \
--url https://{host}/api/{session}/events \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data @- <<EOF
{
"chatId": "5511999999999@c.us",
"event": {
"name": "John's Nail Appointment 💅",
"startTime": 2063137000,
"description": "It's time for your nail care session! 🌟\\n\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\n\\n📍 *Location:* Luxe Nail Studio\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\n\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊",
"endTime": null,
"extraGuestsAllowed": false
},
"reply_to": null
}
EOFimport requests
url = "https://{host}/api/{session}/events"
payload = {
"chatId": "5511999999999@c.us",
"event": {
"name": "John's Nail Appointment 💅",
"startTime": 2063137000,
"description": "It's time for your nail care session! 🌟\n\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\n\n📍 *Location:* Luxe Nail Studio\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\n\nFeel free to arrive *5–10 mins early* so we can get started on time 😊",
"endTime": None,
"extraGuestsAllowed": False
},
"reply_to": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
event: {
name: 'John\'s Nail Appointment 💅',
startTime: 2063137000,
description: 'It\'s time for your nail care session! 🌟\n\nYou\'ll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\n\n📍 *Location:* Luxe Nail Studio\nWe\'re on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\n\nFeel free to arrive *5–10 mins early* so we can get started on time 😊',
endTime: null,
extraGuestsAllowed: false
},
reply_to: null
})
};
fetch('https://{host}/api/{session}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '5511999999999@c.us',
'event' => [
'name' => 'John\'s Nail Appointment 💅',
'startTime' => 2063137000,
'description' => 'It\'s time for your nail care session! 🌟\\n\\nYou\'ll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\n\\n📍 *Location:* Luxe Nail Studio\\nWe\'re on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\n\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊',
'endTime' => null,
'extraGuestsAllowed' => false
],
'reply_to' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/events"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"event\": {\n \"name\": \"John's Nail Appointment 💅\",\n \"startTime\": 2063137000,\n \"description\": \"It's time for your nail care session! 🌟\\\\n\\\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\\\n\\\\n📍 *Location:* Luxe Nail Studio\\\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\\\n\\\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊\",\n \"endTime\": null,\n \"extraGuestsAllowed\": false\n },\n \"reply_to\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/events")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"event\": {\n \"name\": \"John's Nail Appointment 💅\",\n \"startTime\": 2063137000,\n \"description\": \"It's time for your nail care session! 🌟\\\\n\\\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\\\n\\\\n📍 *Location:* Luxe Nail Studio\\\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\\\n\\\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊\",\n \"endTime\": null,\n \"extraGuestsAllowed\": false\n },\n \"reply_to\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"event\": {\n \"name\": \"John's Nail Appointment 💅\",\n \"startTime\": 2063137000,\n \"description\": \"It's time for your nail care session! 🌟\\\\n\\\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\\\n\\\\n📍 *Location:* Luxe Nail Studio\\\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\\\n\\\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊\",\n \"endTime\": null,\n \"extraGuestsAllowed\": false\n },\n \"reply_to\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Send Event Message
Send event message to a contact or group with date, time, and location information
curl --request POST \
--url https://{host}/api/{session}/events \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--data @- <<EOF
{
"chatId": "5511999999999@c.us",
"event": {
"name": "John's Nail Appointment 💅",
"startTime": 2063137000,
"description": "It's time for your nail care session! 🌟\\n\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\n\\n📍 *Location:* Luxe Nail Studio\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\n\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊",
"endTime": null,
"extraGuestsAllowed": false
},
"reply_to": null
}
EOFimport requests
url = "https://{host}/api/{session}/events"
payload = {
"chatId": "5511999999999@c.us",
"event": {
"name": "John's Nail Appointment 💅",
"startTime": 2063137000,
"description": "It's time for your nail care session! 🌟\n\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\n\n📍 *Location:* Luxe Nail Studio\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\n\nFeel free to arrive *5–10 mins early* so we can get started on time 😊",
"endTime": None,
"extraGuestsAllowed": False
},
"reply_to": None
}
headers = {
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
chatId: '5511999999999@c.us',
event: {
name: 'John\'s Nail Appointment 💅',
startTime: 2063137000,
description: 'It\'s time for your nail care session! 🌟\n\nYou\'ll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\n\n📍 *Location:* Luxe Nail Studio\nWe\'re on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\n\nFeel free to arrive *5–10 mins early* so we can get started on time 😊',
endTime: null,
extraGuestsAllowed: false
},
reply_to: null
})
};
fetch('https://{host}/api/{session}/events', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/api/{session}/events",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'chatId' => '5511999999999@c.us',
'event' => [
'name' => 'John\'s Nail Appointment 💅',
'startTime' => 2063137000,
'description' => 'It\'s time for your nail care session! 🌟\\n\\nYou\'ll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\n\\n📍 *Location:* Luxe Nail Studio\\nWe\'re on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\n\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊',
'endTime' => null,
'extraGuestsAllowed' => false
],
'reply_to' => null
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/events"
payload := strings.NewReader("{\n \"chatId\": \"5511999999999@c.us\",\n \"event\": {\n \"name\": \"John's Nail Appointment 💅\",\n \"startTime\": 2063137000,\n \"description\": \"It's time for your nail care session! 🌟\\\\n\\\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\\\n\\\\n📍 *Location:* Luxe Nail Studio\\\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\\\n\\\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊\",\n \"endTime\": null,\n \"extraGuestsAllowed\": false\n },\n \"reply_to\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{host}/api/{session}/events")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"chatId\": \"5511999999999@c.us\",\n \"event\": {\n \"name\": \"John's Nail Appointment 💅\",\n \"startTime\": 2063137000,\n \"description\": \"It's time for your nail care session! 🌟\\\\n\\\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\\\n\\\\n📍 *Location:* Luxe Nail Studio\\\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\\\n\\\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊\",\n \"endTime\": null,\n \"extraGuestsAllowed\": false\n },\n \"reply_to\": null\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/events")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["apikey"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"chatId\": \"5511999999999@c.us\",\n \"event\": {\n \"name\": \"John's Nail Appointment 💅\",\n \"startTime\": 2063137000,\n \"description\": \"It's time for your nail care session! 🌟\\\\n\\\\nYou'll be getting a *classic gel manicure* – clean, polished, and long-lasting. 💖\\\\n\\\\n📍 *Location:* Luxe Nail Studio\\\\nWe're on the *2nd floor of the Plaza Mall*, next to the flower shop. Look for the *pink neon sign*!\\\\n\\\\nFeel free to arrive *5–10 mins early* so we can get started on time 😊\",\n \"endTime\": null,\n \"extraGuestsAllowed\": false\n },\n \"reply_to\": null\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messageId": "3EB0XXXXXX"
}
Description
This endpoint allows you to send event messages to individual contacts or groups on WhatsApp. Events can include information about name, description, time, location, and permission for extra guests.URL Parameters
Body
{
"jid": "5511999999999@s.whatsapp.net",
"event": {
"name": "Team Meeting",
"description": "Description",
"startTime": 0,
"endTime": 0,
"location": {
"name": "Team Meeting",
"latitude": -23.5505,
"longitude": -46.6333
},
"extraGuestsAllowed": true
}
}
Body Parameters
| Property | Type | Required | Description |
|---|---|---|---|
jid | string | ✅ Yes | Recipient identifier (WhatsApp JID). Format: 5511999999999@s.whatsapp.net for contacts or 120363XXXXX@g.us for groups |
event | object | ✅ Yes | Object containing event information |
event.name | string | ✅ Yes | Name of the event |
event.description | string | ❌ No | Event description |
event.startTime | number | ✅ Yes | Unix timestamp (in milliseconds) indicating the event start time |
event.endTime | number | ❌ No | Unix timestamp (in milliseconds) indicating the event end time |
event.location | object | ✅ Yes | Event location information |
event.location.name | string | ✅ Yes | Location name or address |
event.location.latitude | number | ❌ No | Location latitude |
event.location.longitude | number | ❌ No | Location longitude |
event.extraGuestsAllowed | boolean | ✅ Yes | Defines whether extra guests are allowed at the event |
{
"success": true,
"messageId": "3EB0XXXXXX"
}
Status Codes
200- Event sent successfully400- Invalid parameters401- Unauthorized session404- Session not found
Usage Example
curl -X POST https://api.wappfy.com.br/api/my-session/events \
-H "Content-Type: application/json" \
-d '{
"jid": "5511999999999@s.whatsapp.net",
"event": {
"name": "Reunião de Equipe",
"description": "Discussion about Q1 project",
"startTime": 1704034800000,
"endTime": 1704038400000,
"location": {
"name": "Conference Room A, 1000 Main Street",
"latitude": -23.561684,
"longitude": -46.655981
},
"extraGuestsAllowed": true
}
}'
const response = await fetch('https://api.wappfy.com.br/api/my-session/events', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
jid: '5511999999999@s.whatsapp.net',
event: {
name: 'Team Meeting',
description: 'Discussion about Q1 project',
startTime: 1704034800000,
endTime: 1704038400000,
location: {
name: 'Conference Room A, 1000 Main Street',
latitude: -23.561684,
longitude: -46.655981
},
extraGuestsAllowed: true
}
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://api.wappfy.com.br/api/my-session/events',
json={
'jid': '5511999999999@s.whatsapp.net',
'event': {
'name': 'Team Meeting',
'description': 'Discussion about Q1 project',
'startTime': 1704034800000,
'endTime': 1704038400000,
'location': {
'name': 'Conference Room A, 1000 Main Street',
'latitude': -23.561684,
'longitude': -46.655981
},
'extraGuestsAllowed': True
}
}
)
data = response.json()
print(data)
Important Notes
- Timestamps must be in Unix format (milliseconds)
- Location is required, but latitude and longitude are optional
- If
extraGuestsAllowedistrue, guests will be able to bring additional people - The event will be displayed on WhatsApp with a special card containing all provided information
Authorizations
Your Wappfy API key (get it at dash.wappfy.com.br)
Path Parameters
Session name (instanceName)
Body
Response
Message ID
"false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA"
Unix timestamp of when the message was created
1666943582
Chat ID to which this message was sent
"5511999999999@c.us"
Indicates if the message was sent by the current user
The device that sent the message - either API or APP. Available in events (webhooks/websockets) only and only "fromMe: true" messages.
api, app "api"
- ID for who this message is for.
- If the message is sent by the current user, it will be the Chat to which the message is being sent.
- If the message is sent by another user, it will be the ID for the current user.
"5511999999999@c.us"
For groups - participant who sent the message
Message content
Indicates if the message has media available for download
Message acknowledgement (ACK) status
-1, 0, 1, 2, 3, 4 Message acknowledgement status name
Message media object, if any and downloaded
Show child attributes
Show child attributes
If the message was sent to a group, this field will contain the user who sent the message
Location information contained in the message
Show child attributes
Show child attributes
List of vCards contained in the message
Message in raw WhatsApp format. May change at any time, use with caution!
Show child attributes
Show child attributes
