Create a webhook endpoint
curl --request POST \
--url https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://app.example.com/webhooks/kordio",
"status": "active",
"enabled_events": [
"action.requires_approval",
"approval.resolved"
]
}
'import requests
url = "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints"
payload = {
"url": "https://app.example.com/webhooks/kordio",
"status": "active",
"enabled_events": ["action.requires_approval", "approval.resolved"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://app.example.com/webhooks/kordio',
status: 'active',
enabled_events: ['action.requires_approval', 'approval.resolved']
})
};
fetch('https://api.kordio.io/control/v1/workspaces/{workspace_slug}/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://api.kordio.io/control/v1/workspaces/{workspace_slug}/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([
'url' => 'https://app.example.com/webhooks/kordio',
'status' => 'active',
'enabled_events' => [
'action.requires_approval',
'approval.resolved'
]
]),
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 := "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"https://app.example.com/webhooks/kordio\",\n \"status\": \"active\",\n \"enabled_events\": [\n \"action.requires_approval\",\n \"approval.resolved\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://app.example.com/webhooks/kordio\",\n \"status\": \"active\",\n \"enabled_events\": [\n \"action.requires_approval\",\n \"approval.resolved\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://app.example.com/webhooks/kordio\",\n \"status\": \"active\",\n \"enabled_events\": [\n \"action.requires_approval\",\n \"approval.resolved\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"enabled_events": [
"action.requires_approval"
],
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"secret": "whsec_4bSFH1YTkjwsgiMrHMwWJfJTIzsov60WxxsziZAE"
}
}{
"error": {
"message": "Insufficient role",
"code": "insufficient_role"
}
}{
"error": {
"message": "<string>",
"code": "runtime_key_required"
}
}Create a webhook endpoint
Requires manage_policy.
The response carries secret exactly once. Store it immediately; if you lose it,
rotate the endpoint.
An empty enabled_events array subscribes to every event type. Name the ones
you handle instead.
POST
/
control
/
v1
/
workspaces
/
{workspace_slug}
/
webhook_endpoints
Create a webhook endpoint
curl --request POST \
--url https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://app.example.com/webhooks/kordio",
"status": "active",
"enabled_events": [
"action.requires_approval",
"approval.resolved"
]
}
'import requests
url = "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints"
payload = {
"url": "https://app.example.com/webhooks/kordio",
"status": "active",
"enabled_events": ["action.requires_approval", "approval.resolved"]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
url: 'https://app.example.com/webhooks/kordio',
status: 'active',
enabled_events: ['action.requires_approval', 'approval.resolved']
})
};
fetch('https://api.kordio.io/control/v1/workspaces/{workspace_slug}/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://api.kordio.io/control/v1/workspaces/{workspace_slug}/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([
'url' => 'https://app.example.com/webhooks/kordio',
'status' => 'active',
'enabled_events' => [
'action.requires_approval',
'approval.resolved'
]
]),
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 := "https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints"
payload := strings.NewReader("{\n \"url\": \"https://app.example.com/webhooks/kordio\",\n \"status\": \"active\",\n \"enabled_events\": [\n \"action.requires_approval\",\n \"approval.resolved\"\n ]\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://app.example.com/webhooks/kordio\",\n \"status\": \"active\",\n \"enabled_events\": [\n \"action.requires_approval\",\n \"approval.resolved\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.kordio.io/control/v1/workspaces/{workspace_slug}/webhook_endpoints")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \"https://app.example.com/webhooks/kordio\",\n \"status\": \"active\",\n \"enabled_events\": [\n \"action.requires_approval\",\n \"approval.resolved\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"url": "<string>",
"enabled_events": [
"action.requires_approval"
],
"status": "active",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"secret": "whsec_4bSFH1YTkjwsgiMrHMwWJfJTIzsov60WxxsziZAE"
}
}{
"error": {
"message": "Insufficient role",
"code": "insufficient_role"
}
}{
"error": {
"message": "<string>",
"code": "runtime_key_required"
}
}Authorizations
An identity bearer token for a person or your backend. Capabilities are per member, per workspace. This credential can manage the workspace and can never authorize an action as an agent.
Path Parameters
Body
application/json
Example:
"https://app.example.com/webhooks/kordio"
Available options:
active, disabled Available options:
action.requires_approval, action.completed, action.failed, payment.requires_approval, payment.executed, payment.failed, approval.resolved, budget.low, spend_token.expired Example:
[
"action.requires_approval",
"approval.resolved"
]
Response
The endpoint, including its signing secret.
Show child attributes
Show child attributes