Create an event subscription
curl --request POST \
--url https://api.getdialed.ai/flows/event-subscriptions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"definition_id": "def_a1b2c3d4",
"enabled": true,
"event_type": "call.completed"
}
'import requests
url = "https://api.getdialed.ai/flows/event-subscriptions"
payload = {
"definition_id": "def_a1b2c3d4",
"enabled": True,
"event_type": "call.completed"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({definition_id: 'def_a1b2c3d4', enabled: true, event_type: 'call.completed'})
};
fetch('https://api.getdialed.ai/flows/event-subscriptions', 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.getdialed.ai/flows/event-subscriptions",
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([
'definition_id' => 'def_a1b2c3d4',
'enabled' => true,
'event_type' => 'call.completed'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getdialed.ai/flows/event-subscriptions"
payload := strings.NewReader("{\n \"definition_id\": \"def_a1b2c3d4\",\n \"enabled\": true,\n \"event_type\": \"call.completed\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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))
}HttpResponse<String> response = Unirest.post("https://api.getdialed.ai/flows/event-subscriptions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"definition_id\": \"def_a1b2c3d4\",\n \"enabled\": true,\n \"event_type\": \"call.completed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getdialed.ai/flows/event-subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition_id\": \"def_a1b2c3d4\",\n \"enabled\": true,\n \"event_type\": \"call.completed\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-07-09T09:00:00Z",
"definition_id": "def_a1b2c3d4",
"enabled": true,
"event_type": "call.completed",
"id": "evsub_1a2b3c4d5e6f",
"org_id": "org_e5f6g7h8",
"updated_at": "2026-07-09T09:00:00Z"
}{
"detail": "Authentication required"
}{
"detail": "Admin role required"
}{
"detail": "Definition not found"
}{
"detail": "Validation error"
}{
"detail": "Rate limit exceeded"
}event-subscriptions
Create an event subscription
Binds an exact internal event name to a Definition you own. When a matching event is emitted, the subscription’s Definition auto-triggers. A missing or cross-tenant Definition returns 404, never 403.
POST
/
event-subscriptions
Create an event subscription
curl --request POST \
--url https://api.getdialed.ai/flows/event-subscriptions \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"definition_id": "def_a1b2c3d4",
"enabled": true,
"event_type": "call.completed"
}
'import requests
url = "https://api.getdialed.ai/flows/event-subscriptions"
payload = {
"definition_id": "def_a1b2c3d4",
"enabled": True,
"event_type": "call.completed"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({definition_id: 'def_a1b2c3d4', enabled: true, event_type: 'call.completed'})
};
fetch('https://api.getdialed.ai/flows/event-subscriptions', 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.getdialed.ai/flows/event-subscriptions",
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([
'definition_id' => 'def_a1b2c3d4',
'enabled' => true,
'event_type' => 'call.completed'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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.getdialed.ai/flows/event-subscriptions"
payload := strings.NewReader("{\n \"definition_id\": \"def_a1b2c3d4\",\n \"enabled\": true,\n \"event_type\": \"call.completed\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-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))
}HttpResponse<String> response = Unirest.post("https://api.getdialed.ai/flows/event-subscriptions")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"definition_id\": \"def_a1b2c3d4\",\n \"enabled\": true,\n \"event_type\": \"call.completed\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getdialed.ai/flows/event-subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"definition_id\": \"def_a1b2c3d4\",\n \"enabled\": true,\n \"event_type\": \"call.completed\"\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2026-07-09T09:00:00Z",
"definition_id": "def_a1b2c3d4",
"enabled": true,
"event_type": "call.completed",
"id": "evsub_1a2b3c4d5e6f",
"org_id": "org_e5f6g7h8",
"updated_at": "2026-07-09T09:00:00Z"
}{
"detail": "Authentication required"
}{
"detail": "Admin role required"
}{
"detail": "Definition not found"
}{
"detail": "Validation error"
}{
"detail": "Rate limit exceeded"
}Authorizations
APIKeyHeaderHTTPBearer
Body
application/json
⌘I