Create or Update Webhook
curl --request POST \
--url https://app.wachat.net/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/wachat/webhook",
"id": 12,
"name": "Production webhook",
"events": [
"messages.upsert",
"connection.update"
],
"instanceName": "t1_mq9r2jov_jakarta_store",
"enabled": true,
"secret": "whsec_your_custom_secret"
}
'import requests
url = "https://app.wachat.net/api/v1/webhooks"
payload = {
"url": "https://example.com/wachat/webhook",
"id": 12,
"name": "Production webhook",
"events": ["messages.upsert", "connection.update"],
"instanceName": "t1_mq9r2jov_jakarta_store",
"enabled": True,
"secret": "whsec_your_custom_secret"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/wachat/webhook',
id: 12,
name: 'Production webhook',
events: ['messages.upsert', 'connection.update'],
instanceName: 't1_mq9r2jov_jakarta_store',
enabled: true,
secret: 'whsec_your_custom_secret'
})
};
fetch('https://app.wachat.net/api/v1/webhooks', 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://app.wachat.net/api/v1/webhooks",
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([
'url' => 'https://example.com/wachat/webhook',
'id' => 12,
'name' => 'Production webhook',
'events' => [
'messages.upsert',
'connection.update'
],
'instanceName' => 't1_mq9r2jov_jakarta_store',
'enabled' => true,
'secret' => 'whsec_your_custom_secret'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.wachat.net/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/wachat/webhook\",\n \"id\": 12,\n \"name\": \"Production webhook\",\n \"events\": [\n \"messages.upsert\",\n \"connection.update\"\n ],\n \"instanceName\": \"t1_mq9r2jov_jakarta_store\",\n \"enabled\": true,\n \"secret\": \"whsec_your_custom_secret\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.wachat.net/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/wachat/webhook\",\n \"id\": 12,\n \"name\": \"Production webhook\",\n \"events\": [\n \"messages.upsert\",\n \"connection.update\"\n ],\n \"instanceName\": \"t1_mq9r2jov_jakarta_store\",\n \"enabled\": true,\n \"secret\": \"whsec_your_custom_secret\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.wachat.net/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/wachat/webhook\",\n \"id\": 12,\n \"name\": \"Production webhook\",\n \"events\": [\n \"messages.upsert\",\n \"connection.update\"\n ],\n \"instanceName\": \"t1_mq9r2jov_jakarta_store\",\n \"enabled\": true,\n \"secret\": \"whsec_your_custom_secret\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"webhook": {
"id": 12,
"name": "Production webhook",
"url": "https://example.com/wachat/webhook",
"events": [
"messages.upsert",
"connection.update"
],
"enabled": true,
"secret": "whsec_••••abcdef",
"instance": {
"instanceName": "jakarta_store",
"displayName": "jakarta_store",
"apiInstanceName": "t1_mq9r2jov_jakarta_store",
"internalName": "t1_mq9r2jov_jakarta_store"
},
"createdAt": "2026-06-13T08:00:00.000Z",
"updatedAt": "2026-06-13T08:00:00.000Z"
}
}{
"success": true,
"webhook": {
"id": 12,
"name": "Production webhook",
"url": "https://example.com/wachat/webhook",
"events": [
"messages.upsert",
"connection.update"
],
"enabled": true,
"secret": "whsec_••••abcdef",
"instance": {
"instanceName": "jakarta_store",
"displayName": "jakarta_store",
"apiInstanceName": "t1_mq9r2jov_jakarta_store",
"internalName": "t1_mq9r2jov_jakarta_store"
},
"createdAt": "2026-06-13T08:00:00.000Z",
"updatedAt": "2026-06-13T08:00:00.000Z"
}
}Webhooks
Create Webhook
Create a new webhook endpoint, or update an existing webhook by passing its id.
POST
/
webhooks
Create or Update Webhook
curl --request POST \
--url https://app.wachat.net/api/v1/webhooks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/wachat/webhook",
"id": 12,
"name": "Production webhook",
"events": [
"messages.upsert",
"connection.update"
],
"instanceName": "t1_mq9r2jov_jakarta_store",
"enabled": true,
"secret": "whsec_your_custom_secret"
}
'import requests
url = "https://app.wachat.net/api/v1/webhooks"
payload = {
"url": "https://example.com/wachat/webhook",
"id": 12,
"name": "Production webhook",
"events": ["messages.upsert", "connection.update"],
"instanceName": "t1_mq9r2jov_jakarta_store",
"enabled": True,
"secret": "whsec_your_custom_secret"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/wachat/webhook',
id: 12,
name: 'Production webhook',
events: ['messages.upsert', 'connection.update'],
instanceName: 't1_mq9r2jov_jakarta_store',
enabled: true,
secret: 'whsec_your_custom_secret'
})
};
fetch('https://app.wachat.net/api/v1/webhooks', 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://app.wachat.net/api/v1/webhooks",
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([
'url' => 'https://example.com/wachat/webhook',
'id' => 12,
'name' => 'Production webhook',
'events' => [
'messages.upsert',
'connection.update'
],
'instanceName' => 't1_mq9r2jov_jakarta_store',
'enabled' => true,
'secret' => 'whsec_your_custom_secret'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.wachat.net/api/v1/webhooks"
payload := strings.NewReader("{\n \"url\": \"https://example.com/wachat/webhook\",\n \"id\": 12,\n \"name\": \"Production webhook\",\n \"events\": [\n \"messages.upsert\",\n \"connection.update\"\n ],\n \"instanceName\": \"t1_mq9r2jov_jakarta_store\",\n \"enabled\": true,\n \"secret\": \"whsec_your_custom_secret\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.wachat.net/api/v1/webhooks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/wachat/webhook\",\n \"id\": 12,\n \"name\": \"Production webhook\",\n \"events\": [\n \"messages.upsert\",\n \"connection.update\"\n ],\n \"instanceName\": \"t1_mq9r2jov_jakarta_store\",\n \"enabled\": true,\n \"secret\": \"whsec_your_custom_secret\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.wachat.net/api/v1/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/wachat/webhook\",\n \"id\": 12,\n \"name\": \"Production webhook\",\n \"events\": [\n \"messages.upsert\",\n \"connection.update\"\n ],\n \"instanceName\": \"t1_mq9r2jov_jakarta_store\",\n \"enabled\": true,\n \"secret\": \"whsec_your_custom_secret\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"webhook": {
"id": 12,
"name": "Production webhook",
"url": "https://example.com/wachat/webhook",
"events": [
"messages.upsert",
"connection.update"
],
"enabled": true,
"secret": "whsec_••••abcdef",
"instance": {
"instanceName": "jakarta_store",
"displayName": "jakarta_store",
"apiInstanceName": "t1_mq9r2jov_jakarta_store",
"internalName": "t1_mq9r2jov_jakarta_store"
},
"createdAt": "2026-06-13T08:00:00.000Z",
"updatedAt": "2026-06-13T08:00:00.000Z"
}
}{
"success": true,
"webhook": {
"id": 12,
"name": "Production webhook",
"url": "https://example.com/wachat/webhook",
"events": [
"messages.upsert",
"connection.update"
],
"enabled": true,
"secret": "whsec_••••abcdef",
"instance": {
"instanceName": "jakarta_store",
"displayName": "jakarta_store",
"apiInstanceName": "t1_mq9r2jov_jakarta_store",
"internalName": "t1_mq9r2jov_jakarta_store"
},
"createdAt": "2026-06-13T08:00:00.000Z",
"updatedAt": "2026-06-13T08:00:00.000Z"
}
}Create a webhook endpoint for your Wachat account.
Webhooks can listen to all instances or only one specific
To receive events from all instances, omit
using your webhook secret.
apiInstanceName.
Supported events:
*
messages.upsert
messages.update
contacts.update
chats.update
qrcode.updated
connection.update
curl -X POST "https://app.wachat.net/api/v1/webhooks" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Production webhook",
"url": "https://example.com/wachat/webhook",
"instanceName": "t1_mq9r2jov_jakarta_store",
"events": ["messages.upsert", "connection.update"],
"enabled": true
}'
instanceName.
Delivery Headers
Every webhook delivery includes these headers:X-Wachat-Event
X-Wachat-Timestamp
X-Wachat-Signature
X-Wachat-Webhook-Id
X-Wachat-Signature is an HMAC-SHA256 signature of:
timestamp.raw_json_body
The webhook URL must use HTTPS. The secret is returned when creating/updating a webhook. Store it securely.
Authorizations
Authenticate your integration payloads by injecting your premium secure Wachat Account API Private Secret Key inside standard Authorization Bearer header vectors.
Body
application/json
HTTPS endpoint that will receive Wachat webhook deliveries.
Example:
"https://example.com/wachat/webhook"
Existing webhook id. Include this to update a webhook.
Example:
12
Example:
"Production webhook"
Available options:
*, messages.upsert, messages.update, contacts.update, chats.update, qrcode.updated, connection.update Example:
["messages.upsert", "connection.update"]
Optional API instance name. Omit this to receive events for all instances in the account.
Example:
"t1_mq9r2jov_jakarta_store"
Example:
true
Optional custom webhook secret. If omitted, Wachat generates one.
Example:
"whsec_your_custom_secret"
⌘I
