Rotate a webhook signing secret
curl --request POST \
--url https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotationimport requests
url = "https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"endpoint": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"<string>"
],
"secretPrefix": "<string>",
"lastFour": "<string>",
"createdByClerkUserId": "<string>",
"disabledAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"secret": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "unauthorized",
"message": "Authentication is required.",
"requestId": "req_9f8e7d6c"
}
}{
"error": {
"code": "forbidden",
"message": "Your Workspace role cannot perform this action.",
"requestId": "req_9f8e7d6c"
}
}{
"error": {
"code": "webhook_endpoint_not_found",
"message": "The webhook endpoint does not exist in the active Workspace.",
"requestId": "req_9f8e7d6c"
}
}Webhooks
Rotate a webhook signing secret
Replaces the endpoint’s signing secret; the new whsec_… is returned
exactly once. Pending deliveries sign with the new secret. Requires
the webhooks:manage permission.
POST
/
v1
/
webhook-endpoints
/
{endpointId}
/
secret-rotation
Rotate a webhook signing secret
curl --request POST \
--url https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotationimport requests
url = "https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-kordless-instance.com/v1/webhook-endpoints/{endpointId}/secret-rotation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body{
"data": {
"endpoint": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"workspaceId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "<string>",
"eventTypes": [
"<string>"
],
"secretPrefix": "<string>",
"lastFour": "<string>",
"createdByClerkUserId": "<string>",
"disabledAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"secret": "<string>"
},
"requestId": "<string>"
}{
"error": {
"code": "unauthorized",
"message": "Authentication is required.",
"requestId": "req_9f8e7d6c"
}
}{
"error": {
"code": "forbidden",
"message": "Your Workspace role cannot perform this action.",
"requestId": "req_9f8e7d6c"
}
}{
"error": {
"code": "webhook_endpoint_not_found",
"message": "The webhook endpoint does not exist in the active Workspace.",
"requestId": "req_9f8e7d6c"
}
}⌘I