Create a webhook endpoint
curl --request POST \
--url https://your-kordless-instance.com/v1/webhook-endpoints \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "",
"eventTypes": []
}
'import requests
url = "https://your-kordless-instance.com/v1/webhook-endpoints"
payload = {
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "",
"eventTypes": []
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
environmentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
url: '<string>',
description: '',
eventTypes: []
})
};
fetch('https://your-kordless-instance.com/v1/webhook-endpoints', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'environmentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'url' => '<string>',
'description' => '',
'eventTypes' => [
]
]),
CURLOPT_HTTPHEADER => [
"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 := "https://your-kordless-instance.com/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"environmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"url\": \"<string>\",\n \"description\": \"\",\n \"eventTypes\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://your-kordless-instance.com/v1/webhook-endpoints")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"environmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"url\": \"<string>\",\n \"description\": \"\",\n \"eventTypes\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-kordless-instance.com/v1/webhook-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"environmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"url\": \"<string>\",\n \"description\": \"\",\n \"eventTypes\": []\n}"
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": "environment_not_found",
"message": "The Project or Environment does not exist in the active Workspace.",
"requestId": "req_9f8e7d6c"
}
}{
"error": {
"code": "invalid_request",
"message": "The request failed validation.",
"requestId": "req_9f8e7d6c",
"details": {
"fields": {
"url": [
"Expected an HTTPS URL without credentials or fragments"
]
}
}
}
}Webhooks
Create a webhook endpoint
Registers an HTTPS endpoint for one Environment. The signing secret
(whsec_…) is returned exactly once; only its display prefix and
last four characters are retrievable afterwards. Requires the
webhooks:manage permission.
POST
/
v1
/
webhook-endpoints
Create a webhook endpoint
curl --request POST \
--url https://your-kordless-instance.com/v1/webhook-endpoints \
--header 'Content-Type: application/json' \
--data '
{
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "",
"eventTypes": []
}
'import requests
url = "https://your-kordless-instance.com/v1/webhook-endpoints"
payload = {
"projectId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"environmentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"description": "",
"eventTypes": []
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
projectId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
environmentId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
url: '<string>',
description: '',
eventTypes: []
})
};
fetch('https://your-kordless-instance.com/v1/webhook-endpoints', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'projectId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'environmentId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'url' => '<string>',
'description' => '',
'eventTypes' => [
]
]),
CURLOPT_HTTPHEADER => [
"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 := "https://your-kordless-instance.com/v1/webhook-endpoints"
payload := strings.NewReader("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"environmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"url\": \"<string>\",\n \"description\": \"\",\n \"eventTypes\": []\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://your-kordless-instance.com/v1/webhook-endpoints")
.header("Content-Type", "application/json")
.body("{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"environmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"url\": \"<string>\",\n \"description\": \"\",\n \"eventTypes\": []\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your-kordless-instance.com/v1/webhook-endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"projectId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"environmentId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"url\": \"<string>\",\n \"description\": \"\",\n \"eventTypes\": []\n}"
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": "environment_not_found",
"message": "The Project or Environment does not exist in the active Workspace.",
"requestId": "req_9f8e7d6c"
}
}{
"error": {
"code": "invalid_request",
"message": "The request failed validation.",
"requestId": "req_9f8e7d6c",
"details": {
"fields": {
"url": [
"Expected an HTTPS URL without credentials or fragments"
]
}
}
}
}Body
application/json
Maximum string length:
500Maximum string length:
200Maximum array length:
32Available options:
business.created, business.onboarding_completed, business_membership.created, book_version.published, book_publication.rolled_back, quote_intent.requires_input, quote_intent.succeeded, quote_intent.failed ⌘I