curl --request PUT \
--url https://api.buildwithchirp.com/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhook",
"events": [
"messages.sms.sent",
"messages.whatsapp.sent"
],
"headers": {
"X-Custom-Header": "new-value"
}
}
'import requests
url = "https://api.buildwithchirp.com/v1/webhooks/{webhookId}"
payload = {
"url": "https://example.com/webhook",
"events": ["messages.sms.sent", "messages.whatsapp.sent"],
"headers": { "X-Custom-Header": "new-value" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhook',
events: ['messages.sms.sent', 'messages.whatsapp.sent'],
headers: {'X-Custom-Header': 'new-value'}
})
};
fetch('https://api.buildwithchirp.com/v1/webhooks/{webhookId}', 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://api.buildwithchirp.com/v1/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/webhook',
'events' => [
'messages.sms.sent',
'messages.whatsapp.sent'
],
'headers' => [
'X-Custom-Header' => 'new-value'
]
]),
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://api.buildwithchirp.com/v1/webhooks/{webhookId}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"messages.sms.sent\",\n \"messages.whatsapp.sent\"\n ],\n \"headers\": {\n \"X-Custom-Header\": \"new-value\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.buildwithchirp.com/v1/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"messages.sms.sent\",\n \"messages.whatsapp.sent\"\n ],\n \"headers\": {\n \"X-Custom-Header\": \"new-value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"messages.sms.sent\",\n \"messages.whatsapp.sent\"\n ],\n \"headers\": {\n \"X-Custom-Header\": \"new-value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "whk_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"appId": "app_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"url": "https://example.com/webhook",
"events": [
"messages.sms.received",
"messages.whatsapp.sent"
],
"headers": {
"X-Custom-Header": "value"
},
"createdAt": "2021-08-01T00:00:00Z",
"updatedAt": "2021-08-01T00:00:00Z"
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}Update app webhook
Update a webhook’s configuration
curl --request PUT \
--url https://api.buildwithchirp.com/v1/webhooks/{webhookId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://example.com/webhook",
"events": [
"messages.sms.sent",
"messages.whatsapp.sent"
],
"headers": {
"X-Custom-Header": "new-value"
}
}
'import requests
url = "https://api.buildwithchirp.com/v1/webhooks/{webhookId}"
payload = {
"url": "https://example.com/webhook",
"events": ["messages.sms.sent", "messages.whatsapp.sent"],
"headers": { "X-Custom-Header": "new-value" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://example.com/webhook',
events: ['messages.sms.sent', 'messages.whatsapp.sent'],
headers: {'X-Custom-Header': 'new-value'}
})
};
fetch('https://api.buildwithchirp.com/v1/webhooks/{webhookId}', 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://api.buildwithchirp.com/v1/webhooks/{webhookId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'url' => 'https://example.com/webhook',
'events' => [
'messages.sms.sent',
'messages.whatsapp.sent'
],
'headers' => [
'X-Custom-Header' => 'new-value'
]
]),
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://api.buildwithchirp.com/v1/webhooks/{webhookId}"
payload := strings.NewReader("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"messages.sms.sent\",\n \"messages.whatsapp.sent\"\n ],\n \"headers\": {\n \"X-Custom-Header\": \"new-value\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.buildwithchirp.com/v1/webhooks/{webhookId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"messages.sms.sent\",\n \"messages.whatsapp.sent\"\n ],\n \"headers\": {\n \"X-Custom-Header\": \"new-value\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buildwithchirp.com/v1/webhooks/{webhookId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://example.com/webhook\",\n \"events\": [\n \"messages.sms.sent\",\n \"messages.whatsapp.sent\"\n ],\n \"headers\": {\n \"X-Custom-Header\": \"new-value\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "whk_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"appId": "app_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
"url": "https://example.com/webhook",
"events": [
"messages.sms.received",
"messages.whatsapp.sent"
],
"headers": {
"X-Custom-Header": "value"
},
"createdAt": "2021-08-01T00:00:00Z",
"updatedAt": "2021-08-01T00:00:00Z"
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}{
"error": {
"type": "invalid_request_error",
"message": "The phone number \"+1abc\" is not in E.164 format.",
"code": "invalid_phone_number",
"doc_url": "https://docs.buildwithchirp.com/api_reference/error-codes#invalid_phone_number",
"param": "from",
"provider": {
"source": "meta",
"code": 123,
"message": "<string>",
"fbtrace_id": "<string>",
"health_status": {
"entities": [
{
"id": "<string>",
"can_send_message": "AVAILABLE",
"errors": [
{
"error_code": 123,
"error_description": "<string>",
"possible_solution": "<string>"
}
]
}
]
}
},
"additional_info": [
"<string>"
]
}
}Authorizations
App API key (format: sk_live_app_* or sk_test_app_*) for app-level operations
Path Parameters
Unique identifier for a Webhook. Format: whk_[test_]{ksuid}
^whk_(?:test_)?[a-zA-Z0-9]{27}$"whk_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
Body
URL to send webhook events to
"https://example.com/webhook"
Events to trigger webhook. Use messages.sms.* for SMS/MMS events, or messages.whatsapp.* for WhatsApp events.
messages.sms.received, messages.sms.sent, messages.sms.delivered, messages.sms.failed, messages.whatsapp.received, messages.whatsapp.sent, messages.whatsapp.delivered, messages.whatsapp.read, messages.whatsapp.failed, templates.whatsapp.created, templates.whatsapp.updated, templates.whatsapp.deleted, templates.whatsapp.connected, contacts.whatsapp.created, contacts.whatsapp.updated, contacts.whatsapp.deleted, whatsapp.account.connected, whatsapp.account.disconnected [
"messages.sms.sent",
"messages.whatsapp.sent"
]
Custom headers to include in webhook requests
Show child attributes
Show child attributes
{ "X-Custom-Header": "new-value" }
Response
Update webhook
Unique identifier for a Webhook. Format: whk_[test_]{ksuid}
^whk_(?:test_)?[a-zA-Z0-9]{27}$"whk_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
Unique identifier for a App. Format: app_[test_]{ksuid}
^app_(?:test_)?[a-zA-Z0-9]{27}$"app_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
URL to send webhook events to
"https://example.com/webhook"
Events that trigger this webhook
[
"messages.sms.received",
"messages.whatsapp.sent"
]
Custom headers included in webhook requests
Show child attributes
Show child attributes
{ "X-Custom-Header": "value" }
When the webhook was created
"2021-08-01T00:00:00Z"
When the webhook was last updated
"2021-08-01T00:00:00Z"