curl --request PUT \
--url https://api.routa.chat/v1/partner/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://crm.example.com/routa",
"subscribed_types": [
"message.*",
"channel.status_changed"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://crm.example.com/routa',
subscribed_types: ['message.*', 'channel.status_changed']
})
};
fetch('https://api.routa.chat/v1/partner/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/partner/webhook"
payload = {
"url": "https://crm.example.com/routa",
"subscribed_types": ["message.*", "channel.status_changed"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/v1/partner/webhook",
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://crm.example.com/routa',
'subscribed_types' => [
'message.*',
'channel.status_changed'
]
]),
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.routa.chat/v1/partner/webhook"
payload := strings.NewReader("{\n \"url\": \"https://crm.example.com/routa\",\n \"subscribed_types\": [\n \"message.*\",\n \"channel.status_changed\"\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))
}{
"id": "whe_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"url": "https://example.com/webhooks/routa",
"subscribed_types": [
"<string>"
],
"api_version": "<string>",
"status": "enabled",
"consecutive_failures": 123,
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"created_at": "2026-09-04T13:22:41.031Z"
}{
"id": "whe_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"url": "https://example.com/webhooks/routa",
"subscribed_types": [
"<string>"
],
"api_version": "<string>",
"status": "enabled",
"consecutive_failures": 123,
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"created_at": "2026-09-04T13:22:41.031Z",
"secret": "whsec_..."
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}Set organization webhook
Sets the only webhook endpoint of the organization, which receives the events of all your customers. Each event carries the project_id and the external_ref of the project, so you route by your own ID without keeping a lookup table.
The first call creates the endpoint and returns 201 with the signing secret, shown only once. Later calls (200) replace the URL and the subscribed types, re-enable the endpoint and do not return the secret.
Signatures and attempts follow the rules of a project’s webhooks. You can also keep endpoints on individual projects: in that case, you receive both deliveries.
An endpoint that carries many customers is the bottleneck of all of them. It has at most 32 concurrent deliveries (8 on a project endpoint), so answer fast and queue the work on your side. See Organization webhook.
curl --request PUT \
--url https://api.routa.chat/v1/partner/webhook \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://crm.example.com/routa",
"subscribed_types": [
"message.*",
"channel.status_changed"
]
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://crm.example.com/routa',
subscribed_types: ['message.*', 'channel.status_changed']
})
};
fetch('https://api.routa.chat/v1/partner/webhook', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.routa.chat/v1/partner/webhook"
payload = {
"url": "https://crm.example.com/routa",
"subscribed_types": ["message.*", "channel.status_changed"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.routa.chat/v1/partner/webhook",
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://crm.example.com/routa',
'subscribed_types' => [
'message.*',
'channel.status_changed'
]
]),
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.routa.chat/v1/partner/webhook"
payload := strings.NewReader("{\n \"url\": \"https://crm.example.com/routa\",\n \"subscribed_types\": [\n \"message.*\",\n \"channel.status_changed\"\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))
}{
"id": "whe_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"url": "https://example.com/webhooks/routa",
"subscribed_types": [
"<string>"
],
"api_version": "<string>",
"status": "enabled",
"consecutive_failures": 123,
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"created_at": "2026-09-04T13:22:41.031Z"
}{
"id": "whe_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"url": "https://example.com/webhooks/routa",
"subscribed_types": [
"<string>"
],
"api_version": "<string>",
"status": "enabled",
"consecutive_failures": 123,
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"created_at": "2026-09-04T13:22:41.031Z",
"secret": "whsec_..."
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}{
"error": {
"type": "invalid_request_error",
"code": "channel_inactive",
"message": "Channel chan_01J8... is not active and cannot send messages.",
"request_id": "req_01J8ZK9M3Q7XABCDEFGHJKMNPQ",
"param": "components.buttons.0.example",
"doc_url": "<string>",
"details": {}
}
}Authorizations
Body
Response
Endpoint updated and re-enabled. The response does not include the secret