Update a webhook endpoint
curl --request PATCH \
--url https://api.kit.com/v4/webhook_endpoints/{id} \
--header 'Content-Type: application/json' \
--header 'X-Kit-Api-Key: <api-key>' \
--data '
{
"name": "Updated name",
"url": "https://hooks.example.com/v2",
"description": "Now with details",
"status": "active",
"events": [
"subscriber.activated"
]
}
'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/webhook_endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated name\",\n \"url\": \"https://hooks.example.com/v2\",\n \"description\": \"Now with details\",\n \"status\": \"active\",\n \"events\": [\n \"subscriber.activated\"\n ]\n}"
response = http.request(request)
puts response.read_bodyconst options = {
method: 'PATCH',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated name',
url: 'https://hooks.example.com/v2',
description: 'Now with details',
status: 'active',
events: ['subscriber.activated']
})
};
fetch('https://api.kit.com/v4/webhook_endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/webhook_endpoints/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated name\",\n \"url\": \"https://hooks.example.com/v2\",\n \"description\": \"Now with details\",\n \"status\": \"active\",\n \"events\": [\n \"subscriber.activated\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
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.kit.com/v4/webhook_endpoints/{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' => 'Updated name',
'url' => 'https://hooks.example.com/v2',
'description' => 'Now with details',
'status' => 'active',
'events' => [
'subscriber.activated'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/webhook_endpoints/{id}"
payload = {
"name": "Updated name",
"url": "https://hooks.example.com/v2",
"description": "Now with details",
"status": "active",
"events": ["subscriber.activated"]
}
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"webhook_endpoint": {
"id": 29,
"name": "Updated name",
"url": "https://hooks.example.com/v2",
"events": [
"subscriber.activated"
],
"status": "active",
"source": "creator",
"description": "Now with details",
"created_by_app": null,
"created_at": "2023-02-17T11:43:55Z",
"previous_secret_expires_at": null
}
}{
"errors": [
"Not Found"
]
}Webhooks
Update a webhook endpoint
Updates any of name, url, description, status, and events. Set status to disabled to stop deliveries without deleting the endpoint, and back to active to resume.
Note: events replaces the endpoint’s entire subscription list — send the complete set you want, not just the additions.
Endpoints created by an app (via OAuth) can only be updated by that app; an API key request returns 403.
PATCH
/
v4
/
webhook_endpoints
/
{id}
Update a webhook endpoint
curl --request PATCH \
--url https://api.kit.com/v4/webhook_endpoints/{id} \
--header 'Content-Type: application/json' \
--header 'X-Kit-Api-Key: <api-key>' \
--data '
{
"name": "Updated name",
"url": "https://hooks.example.com/v2",
"description": "Now with details",
"status": "active",
"events": [
"subscriber.activated"
]
}
'require 'uri'
require 'net/http'
url = URI("https://api.kit.com/v4/webhook_endpoints/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Kit-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Updated name\",\n \"url\": \"https://hooks.example.com/v2\",\n \"description\": \"Now with details\",\n \"status\": \"active\",\n \"events\": [\n \"subscriber.activated\"\n ]\n}"
response = http.request(request)
puts response.read_bodyconst options = {
method: 'PATCH',
headers: {'X-Kit-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Updated name',
url: 'https://hooks.example.com/v2',
description: 'Now with details',
status: 'active',
events: ['subscriber.activated']
})
};
fetch('https://api.kit.com/v4/webhook_endpoints/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.kit.com/v4/webhook_endpoints/{id}"
payload := strings.NewReader("{\n \"name\": \"Updated name\",\n \"url\": \"https://hooks.example.com/v2\",\n \"description\": \"Now with details\",\n \"status\": \"active\",\n \"events\": [\n \"subscriber.activated\"\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Kit-Api-Key", "<api-key>")
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.kit.com/v4/webhook_endpoints/{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' => 'Updated name',
'url' => 'https://hooks.example.com/v2',
'description' => 'Now with details',
'status' => 'active',
'events' => [
'subscriber.activated'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Kit-Api-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://api.kit.com/v4/webhook_endpoints/{id}"
payload = {
"name": "Updated name",
"url": "https://hooks.example.com/v2",
"description": "Now with details",
"status": "active",
"events": ["subscriber.activated"]
}
headers = {
"X-Kit-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"webhook_endpoint": {
"id": 29,
"name": "Updated name",
"url": "https://hooks.example.com/v2",
"events": [
"subscriber.activated"
],
"status": "active",
"source": "creator",
"description": "Now with details",
"created_by_app": null,
"created_at": "2023-02-17T11:43:55Z",
"previous_secret_expires_at": null
}
}{
"errors": [
"Not Found"
]
}Authorizations
API KeyOAuth2
Authenticate API requests via an API Key
Path Parameters
Body
application/json
Response
Updates the webhook endpoint
Show child attributes
Show child attributes
Related topics
Delete a webhook endpointCreate a webhook endpointWebhooks overviewGet a webhook endpointList webhook endpointsWas this page helpful?