Update webhook
curl --request PUT \
--url https://your-instance.example.com/api/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"events": [
"<string>"
],
"headers": [
{
"name": "X-Custom-Header",
"value": "my-value"
}
],
"hmacKey": "<string>",
"retries": {
"attempts": 3,
"delaySeconds": 5,
"policy": "exponential"
},
"url": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
events: ['<string>'],
headers: [{name: 'X-Custom-Header', value: 'my-value'}],
hmacKey: '<string>',
retries: {attempts: 3, delaySeconds: 5, policy: 'exponential'},
url: '<string>'
})
};
fetch('https://your-instance.example.com/api/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.example.com/api/webhooks/{id}"
payload = {
"enabled": True,
"events": ["<string>"],
"headers": [
{
"name": "X-Custom-Header",
"value": "my-value"
}
],
"hmacKey": "<string>",
"retries": {
"attempts": 3,
"delaySeconds": 5,
"policy": "exponential"
},
"url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/webhooks/{id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"events\": [\n \"<string>\"\n ],\n \"headers\": [\n {\n \"name\": \"X-Custom-Header\",\n \"value\": \"my-value\"\n }\n ],\n \"hmacKey\": \"<string>\",\n \"retries\": {\n \"attempts\": 3,\n \"delaySeconds\": 5,\n \"policy\": \"exponential\"\n },\n \"url\": \"<string>\"\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/webhooks/{id}",
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([
'enabled' => true,
'events' => [
'<string>'
],
'headers' => [
[
'name' => 'X-Custom-Header',
'value' => 'my-value'
]
],
'hmacKey' => '<string>',
'retries' => [
'attempts' => 3,
'delaySeconds' => 5,
'policy' => 'exponential'
],
'url' => '<string>'
]),
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;
}{
"createdAt": "<string>",
"enabled": true,
"events": [
"<string>"
],
"headers": [
{
"name": "X-Custom-Header",
"value": "my-value"
}
],
"id": 123,
"retries": {
"attempts": 3,
"delaySeconds": 5,
"policy": "exponential"
},
"session": "<string>",
"tenantId": "<string>",
"url": "<string>"
}{
"docs": "https://docs.polymorfa.com/api/messages/send",
"error": "missing required field: chatId"
}{
"docs": "https://docs.polymorfa.com/api/sessions",
"error": "session not found"
}{
"error": "internal server error"
}{
"docs": "<string>",
"error": "<string>"
}webhooks
Update webhook
Updates a webhook configuration
PUT
/
api
/
webhooks
/
{id}
Update webhook
curl --request PUT \
--url https://your-instance.example.com/api/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"events": [
"<string>"
],
"headers": [
{
"name": "X-Custom-Header",
"value": "my-value"
}
],
"hmacKey": "<string>",
"retries": {
"attempts": 3,
"delaySeconds": 5,
"policy": "exponential"
},
"url": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
events: ['<string>'],
headers: [{name: 'X-Custom-Header', value: 'my-value'}],
hmacKey: '<string>',
retries: {attempts: 3, delaySeconds: 5, policy: 'exponential'},
url: '<string>'
})
};
fetch('https://your-instance.example.com/api/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://your-instance.example.com/api/webhooks/{id}"
payload = {
"enabled": True,
"events": ["<string>"],
"headers": [
{
"name": "X-Custom-Header",
"value": "my-value"
}
],
"hmacKey": "<string>",
"retries": {
"attempts": 3,
"delaySeconds": 5,
"policy": "exponential"
},
"url": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://your-instance.example.com/api/webhooks/{id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"events\": [\n \"<string>\"\n ],\n \"headers\": [\n {\n \"name\": \"X-Custom-Header\",\n \"value\": \"my-value\"\n }\n ],\n \"hmacKey\": \"<string>\",\n \"retries\": {\n \"attempts\": 3,\n \"delaySeconds\": 5,\n \"policy\": \"exponential\"\n },\n \"url\": \"<string>\"\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))
}<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-instance.example.com/api/webhooks/{id}",
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([
'enabled' => true,
'events' => [
'<string>'
],
'headers' => [
[
'name' => 'X-Custom-Header',
'value' => 'my-value'
]
],
'hmacKey' => '<string>',
'retries' => [
'attempts' => 3,
'delaySeconds' => 5,
'policy' => 'exponential'
],
'url' => '<string>'
]),
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;
}{
"createdAt": "<string>",
"enabled": true,
"events": [
"<string>"
],
"headers": [
{
"name": "X-Custom-Header",
"value": "my-value"
}
],
"id": 123,
"retries": {
"attempts": 3,
"delaySeconds": 5,
"policy": "exponential"
},
"session": "<string>",
"tenantId": "<string>",
"url": "<string>"
}{
"docs": "https://docs.polymorfa.com/api/messages/send",
"error": "missing required field: chatId"
}{
"docs": "https://docs.polymorfa.com/api/sessions",
"error": "session not found"
}{
"error": "internal server error"
}{
"docs": "<string>",
"error": "<string>"
}Authorizations
Scoped API key created via POST /api/account/keys.
Path Parameters
Webhook ID
Body
application/json
Fields to update
Whether to enable or disable the webhook
New list of subscribed event types
Updated custom HTTP headers
Show child attributes
Show child attributes
New HMAC secret key for signature verification
Show child attributes
Show child attributes
New target URL for webhook delivery
Response
OK
When the webhook was registered
Whether this webhook is active
Subscribed event types (empty = all events)
Custom HTTP headers included with each delivery
Show child attributes
Show child attributes
Unique webhook identifier
Show child attributes
Show child attributes
Session name to filter events for (null = all sessions)
Tenant that owns this webhook
Target URL for webhook delivery