Update a webhook
curl --request PUT \
--url https://api.polymorfa.com/api/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"hmacKey": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
events: ['<string>'],
hmacKey: '<string>',
headers: [{name: '<string>', value: '<string>'}],
enabled: true
})
};
fetch('https://api.polymorfa.com/api/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/webhooks/{id}"
payload = {
"url": "<string>",
"events": ["<string>"],
"hmacKey": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": True
}
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://api.polymorfa.com/api/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"hmacKey\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true\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://api.polymorfa.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([
'url' => '<string>',
'events' => [
'<string>'
],
'hmacKey' => '<string>',
'headers' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'enabled' => true
]),
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;
}{
"success": true,
"data": {
"id": "<string>",
"tenantId": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"retries": {
"attempts": 1,
"delaySeconds": 1,
"policy": "<string>"
},
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true,
"createdAt": "<string>",
"session": "<string>",
"format": "native"
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Webhooks
Update a webhook
PUT
/
api
/
webhooks
/
{id}
Update a webhook
curl --request PUT \
--url https://api.polymorfa.com/api/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [
"<string>"
],
"hmacKey": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: '<string>',
events: ['<string>'],
hmacKey: '<string>',
headers: [{name: '<string>', value: '<string>'}],
enabled: true
})
};
fetch('https://api.polymorfa.com/api/webhooks/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.polymorfa.com/api/webhooks/{id}"
payload = {
"url": "<string>",
"events": ["<string>"],
"hmacKey": "<string>",
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": True
}
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://api.polymorfa.com/api/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"hmacKey\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"enabled\": true\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://api.polymorfa.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([
'url' => '<string>',
'events' => [
'<string>'
],
'hmacKey' => '<string>',
'headers' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'enabled' => true
]),
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;
}{
"success": true,
"data": {
"id": "<string>",
"tenantId": "<string>",
"url": "<string>",
"events": [
"<string>"
],
"retries": {
"attempts": 1,
"delaySeconds": 1,
"policy": "<string>"
},
"headers": [
{
"name": "<string>",
"value": "<string>"
}
],
"enabled": true,
"createdAt": "<string>",
"session": "<string>",
"format": "native"
}
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}{
"error": "<string>",
"docs": "<string>"
}Authorizations
Polymorfa organization key (titan_ prefix), project token (titan_pt_ prefix), or client token (titan_ct_ prefix), where the operation permits that audience.
Path Parameters
Body
application/json