Send an event message
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"
}
Events
Send Event Message
Send event message to a contact or group with date, time, and location information
POST
/
api
/
{session}
/
events
Send an event message
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
Body
application/json
Response
201 - application/json
