Update a webhook endpoint
curl --request PATCH \
--url http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"labels": [
"<string>"
],
"url": "<string>",
"enabled": true,
"subscribed_event_types": [],
"undelivered_payload_retention_hours": 0
}
'import requests
url = "http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}"
payload = {
"name": "<string>",
"labels": ["<string>"],
"url": "<string>",
"enabled": True,
"subscribed_event_types": [],
"undelivered_payload_retention_hours": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
labels: ['<string>'],
url: '<string>',
enabled: true,
subscribed_event_types: [],
undelivered_payload_retention_hours: 0
})
};
fetch('http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8787",
CURLOPT_URL => "http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'labels' => [
'<string>'
],
'url' => '<string>',
'enabled' => true,
'subscribed_event_types' => [
],
'undelivered_payload_retention_hours' => 0
]),
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 := "http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"enabled\": true,\n \"subscribed_event_types\": [],\n \"undelivered_payload_retention_hours\": 0\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"enabled\": true,\n \"subscribed_event_types\": [],\n \"undelivered_payload_retention_hours\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"enabled\": true,\n \"subscribed_event_types\": [],\n \"undelivered_payload_retention_hours\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"labels": [
"<string>"
],
"url": "<string>",
"enabled": true,
"subscribed_event_types": [
"verification.session.succeeded"
],
"created_at": "<string>",
"updated_at": "<string>",
"disabled_at": "<string>",
"undelivered_payload_retention_hours": 72
},
"error": null
}{
"data": null,
"error": {
"code": "BAD_REQUEST",
"message": "Bad request.",
"hint": "At least one of `name`, `labels`, `url`, `enabled`, `subscribed_event_types` or `undelivered_payload_retention_hours` must be provided.",
"docs": "https://kayle.id/docs/api/webhooks/endpoints#update"
}
}{
"data": null,
"error": {
"code": "NOT_FOUND",
"message": "Webhook endpoint not found.",
"hint": "The webhook endpoint with the given ID was not found.",
"docs": "https://kayle.id/docs/api/webhooks/endpoints#update"
}
}{
"data": null,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error.",
"hint": "The server encountered an error.",
"docs": "https://kayle.id/docs/api/errors"
}
}Webhooks
Update a webhook endpoint
Update URL and/or enabled state of a webhook endpoint.
PATCH
/
v1
/
webhooks
/
endpoints
/
{endpoint_id}
Update a webhook endpoint
curl --request PATCH \
--url http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"labels": [
"<string>"
],
"url": "<string>",
"enabled": true,
"subscribed_event_types": [],
"undelivered_payload_retention_hours": 0
}
'import requests
url = "http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}"
payload = {
"name": "<string>",
"labels": ["<string>"],
"url": "<string>",
"enabled": True,
"subscribed_event_types": [],
"undelivered_payload_retention_hours": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
labels: ['<string>'],
url: '<string>',
enabled: true,
subscribed_event_types: [],
undelivered_payload_retention_hours: 0
})
};
fetch('http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8787",
CURLOPT_URL => "http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'labels' => [
'<string>'
],
'url' => '<string>',
'enabled' => true,
'subscribed_event_types' => [
],
'undelivered_payload_retention_hours' => 0
]),
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 := "http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"enabled\": true,\n \"subscribed_event_types\": [],\n \"undelivered_payload_retention_hours\": 0\n}")
req, _ := http.NewRequest("PATCH", 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.patch("http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"enabled\": true,\n \"subscribed_event_types\": [],\n \"undelivered_payload_retention_hours\": 0\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:8787/v1/webhooks/endpoints/{endpoint_id}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"url\": \"<string>\",\n \"enabled\": true,\n \"subscribed_event_types\": [],\n \"undelivered_payload_retention_hours\": 0\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"organization_id": "<string>",
"name": "<string>",
"labels": [
"<string>"
],
"url": "<string>",
"enabled": true,
"subscribed_event_types": [
"verification.session.succeeded"
],
"created_at": "<string>",
"updated_at": "<string>",
"disabled_at": "<string>",
"undelivered_payload_retention_hours": 72
},
"error": null
}{
"data": null,
"error": {
"code": "BAD_REQUEST",
"message": "Bad request.",
"hint": "At least one of `name`, `labels`, `url`, `enabled`, `subscribed_event_types` or `undelivered_payload_retention_hours` must be provided.",
"docs": "https://kayle.id/docs/api/webhooks/endpoints#update"
}
}{
"data": null,
"error": {
"code": "NOT_FOUND",
"message": "Webhook endpoint not found.",
"hint": "The webhook endpoint with the given ID was not found.",
"docs": "https://kayle.id/docs/api/webhooks/endpoints#update"
}
}{
"data": null,
"error": {
"code": "INTERNAL_SERVER_ERROR",
"message": "Internal server error.",
"hint": "The server encountered an error.",
"docs": "https://kayle.id/docs/api/errors"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The ID of the webhook endpoint to update (e.g. whe_...).
Required string length:
1 - 128Pattern:
^[A-Za-z0-9_-]+$Body
application/json
Updated display name for the webhook endpoint.
Required string length:
1 - 120Updated tag-style purpose labels for the endpoint.
Maximum array length:
8New URL for the webhook endpoint. Must use https:// (http:// is only accepted for localhost in development).
Maximum string length:
2048New enabled state for the webhook endpoint.
The updated event subscriptions for the endpoint.
Available options:
verification.session.succeeded, verification.session.failed, verification.session.expired, verification.session.cancelled undelivered_payload_retention_hours
Option 1 · enum<number>Option 2 · enum<number>Option 3 · enum<number>Option 4 · enum<number>
How long Kayle should retain encrypted undelivered payloads after terminal delivery failure.
Available options:
0 ⌘I