Create Subscription
Subscriptions.
POST
/
v1
/
webhooks
/
subscriptions
cURL
curl --request POST \
--url https://api.domesystems.ai/v1/webhooks/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "<string>",
"destination_id": "<string>",
"name": "<string>",
"event_types": [
"<string>"
],
"filters": {},
"delivery_endpoint": {
"workspace_id": "<string>",
"name": "<string>",
"endpoint_url": "<string>",
"headers": [
{
"name": "<string>",
"source": "<string>",
"value": "<string>"
}
],
"content_format": "<string>",
"provider_key": "<string>",
"provider_settings": {},
"provider_credentials": {}
}
}
'import requests
url = "https://api.domesystems.ai/v1/webhooks/subscriptions"
payload = {
"workspace_id": "<string>",
"destination_id": "<string>",
"name": "<string>",
"event_types": ["<string>"],
"filters": {},
"delivery_endpoint": {
"workspace_id": "<string>",
"name": "<string>",
"endpoint_url": "<string>",
"headers": [
{
"name": "<string>",
"source": "<string>",
"value": "<string>"
}
],
"content_format": "<string>",
"provider_key": "<string>",
"provider_settings": {},
"provider_credentials": {}
}
}
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({
workspace_id: '<string>',
destination_id: '<string>',
name: '<string>',
event_types: ['<string>'],
filters: {},
delivery_endpoint: {
workspace_id: '<string>',
name: '<string>',
endpoint_url: '<string>',
headers: [{name: '<string>', source: '<string>', value: '<string>'}],
content_format: '<string>',
provider_key: '<string>',
provider_settings: {},
provider_credentials: {}
}
})
};
fetch('https://api.domesystems.ai/v1/webhooks/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.domesystems.ai/v1/webhooks/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([
'workspace_id' => '<string>',
'destination_id' => '<string>',
'name' => '<string>',
'event_types' => [
'<string>'
],
'filters' => [
],
'delivery_endpoint' => [
'workspace_id' => '<string>',
'name' => '<string>',
'endpoint_url' => '<string>',
'headers' => [
[
'name' => '<string>',
'source' => '<string>',
'value' => '<string>'
]
],
'content_format' => '<string>',
'provider_key' => '<string>',
'provider_settings' => [
],
'provider_credentials' => [
]
]
]),
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.domesystems.ai/v1/webhooks/subscriptions"
payload := strings.NewReader("{\n \"workspace_id\": \"<string>\",\n \"destination_id\": \"<string>\",\n \"name\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"filters\": {},\n \"delivery_endpoint\": {\n \"workspace_id\": \"<string>\",\n \"name\": \"<string>\",\n \"endpoint_url\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"content_format\": \"<string>\",\n \"provider_key\": \"<string>\",\n \"provider_settings\": {},\n \"provider_credentials\": {}\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.domesystems.ai/v1/webhooks/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"<string>\",\n \"destination_id\": \"<string>\",\n \"name\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"filters\": {},\n \"delivery_endpoint\": {\n \"workspace_id\": \"<string>\",\n \"name\": \"<string>\",\n \"endpoint_url\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"content_format\": \"<string>\",\n \"provider_key\": \"<string>\",\n \"provider_settings\": {},\n \"provider_credentials\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.domesystems.ai/v1/webhooks/subscriptions")
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 \"workspace_id\": \"<string>\",\n \"destination_id\": \"<string>\",\n \"name\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"filters\": {},\n \"delivery_endpoint\": {\n \"workspace_id\": \"<string>\",\n \"name\": \"<string>\",\n \"endpoint_url\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"content_format\": \"<string>\",\n \"provider_key\": \"<string>\",\n \"provider_settings\": {},\n \"provider_credentials\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"id": "<string>",
"workspace_id": "<string>",
"tenant_id": "<string>",
"destination_id": "<string>",
"name": "<string>",
"event_types": [
"<string>"
],
"filters": {},
"active": true,
"created_by_user_id": "<string>",
"updated_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"delivery_endpoint": {
"id": "<string>",
"workspace_id": "<string>",
"tenant_id": "<string>",
"name": "<string>",
"destination_type": "<string>",
"endpoint_url": "<string>",
"active": true,
"health_status": "<string>",
"circuit_state": "<string>",
"rate_limit_per_second": 123,
"concurrency_limit": 123,
"request_timeout_seconds": 123,
"max_body_bytes": 123,
"signing_key_id": "<string>",
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"updated_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"headers": [
{
"name": "<string>",
"source": "<string>",
"value": "<string>"
}
],
"provider_key": "<string>",
"provider_settings": {},
"content_format": "<string>"
},
"signing_secret": "<string>",
"signing_key_id": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
destination_id supports subscriptions that already point at an existing endpoint. New user-facing creates instead send delivery_endpoint so the endpoint and subscription can be committed atomically.
Show child attributes
Show child attributes
Response
200 - application/json
OK
Was this page helpful?
⌘I
cURL
curl --request POST \
--url https://api.domesystems.ai/v1/webhooks/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"workspace_id": "<string>",
"destination_id": "<string>",
"name": "<string>",
"event_types": [
"<string>"
],
"filters": {},
"delivery_endpoint": {
"workspace_id": "<string>",
"name": "<string>",
"endpoint_url": "<string>",
"headers": [
{
"name": "<string>",
"source": "<string>",
"value": "<string>"
}
],
"content_format": "<string>",
"provider_key": "<string>",
"provider_settings": {},
"provider_credentials": {}
}
}
'import requests
url = "https://api.domesystems.ai/v1/webhooks/subscriptions"
payload = {
"workspace_id": "<string>",
"destination_id": "<string>",
"name": "<string>",
"event_types": ["<string>"],
"filters": {},
"delivery_endpoint": {
"workspace_id": "<string>",
"name": "<string>",
"endpoint_url": "<string>",
"headers": [
{
"name": "<string>",
"source": "<string>",
"value": "<string>"
}
],
"content_format": "<string>",
"provider_key": "<string>",
"provider_settings": {},
"provider_credentials": {}
}
}
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({
workspace_id: '<string>',
destination_id: '<string>',
name: '<string>',
event_types: ['<string>'],
filters: {},
delivery_endpoint: {
workspace_id: '<string>',
name: '<string>',
endpoint_url: '<string>',
headers: [{name: '<string>', source: '<string>', value: '<string>'}],
content_format: '<string>',
provider_key: '<string>',
provider_settings: {},
provider_credentials: {}
}
})
};
fetch('https://api.domesystems.ai/v1/webhooks/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.domesystems.ai/v1/webhooks/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([
'workspace_id' => '<string>',
'destination_id' => '<string>',
'name' => '<string>',
'event_types' => [
'<string>'
],
'filters' => [
],
'delivery_endpoint' => [
'workspace_id' => '<string>',
'name' => '<string>',
'endpoint_url' => '<string>',
'headers' => [
[
'name' => '<string>',
'source' => '<string>',
'value' => '<string>'
]
],
'content_format' => '<string>',
'provider_key' => '<string>',
'provider_settings' => [
],
'provider_credentials' => [
]
]
]),
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.domesystems.ai/v1/webhooks/subscriptions"
payload := strings.NewReader("{\n \"workspace_id\": \"<string>\",\n \"destination_id\": \"<string>\",\n \"name\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"filters\": {},\n \"delivery_endpoint\": {\n \"workspace_id\": \"<string>\",\n \"name\": \"<string>\",\n \"endpoint_url\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"content_format\": \"<string>\",\n \"provider_key\": \"<string>\",\n \"provider_settings\": {},\n \"provider_credentials\": {}\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.domesystems.ai/v1/webhooks/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"workspace_id\": \"<string>\",\n \"destination_id\": \"<string>\",\n \"name\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"filters\": {},\n \"delivery_endpoint\": {\n \"workspace_id\": \"<string>\",\n \"name\": \"<string>\",\n \"endpoint_url\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"content_format\": \"<string>\",\n \"provider_key\": \"<string>\",\n \"provider_settings\": {},\n \"provider_credentials\": {}\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.domesystems.ai/v1/webhooks/subscriptions")
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 \"workspace_id\": \"<string>\",\n \"destination_id\": \"<string>\",\n \"name\": \"<string>\",\n \"event_types\": [\n \"<string>\"\n ],\n \"filters\": {},\n \"delivery_endpoint\": {\n \"workspace_id\": \"<string>\",\n \"name\": \"<string>\",\n \"endpoint_url\": \"<string>\",\n \"headers\": [\n {\n \"name\": \"<string>\",\n \"source\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"content_format\": \"<string>\",\n \"provider_key\": \"<string>\",\n \"provider_settings\": {},\n \"provider_credentials\": {}\n }\n}"
response = http.request(request)
puts response.read_body{
"subscription": {
"id": "<string>",
"workspace_id": "<string>",
"tenant_id": "<string>",
"destination_id": "<string>",
"name": "<string>",
"event_types": [
"<string>"
],
"filters": {},
"active": true,
"created_by_user_id": "<string>",
"updated_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
},
"delivery_endpoint": {
"id": "<string>",
"workspace_id": "<string>",
"tenant_id": "<string>",
"name": "<string>",
"destination_type": "<string>",
"endpoint_url": "<string>",
"active": true,
"health_status": "<string>",
"circuit_state": "<string>",
"rate_limit_per_second": 123,
"concurrency_limit": 123,
"request_timeout_seconds": 123,
"max_body_bytes": 123,
"signing_key_id": "<string>",
"last_success_at": "2023-11-07T05:31:56Z",
"last_failure_at": "2023-11-07T05:31:56Z",
"created_by_user_id": "<string>",
"updated_by_user_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"headers": [
{
"name": "<string>",
"source": "<string>",
"value": "<string>"
}
],
"provider_key": "<string>",
"provider_settings": {},
"content_format": "<string>"
},
"signing_secret": "<string>",
"signing_key_id": "<string>"
}