curl --request POST \
--url https://api.hightouch.com/api/v1/events/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"events": [
{
"schema": {},
"version": "<string>",
"slug": "<string>",
"name": "<string>"
}
],
"components": [
{
"name": "<string>",
"schema": {},
"id": "<string>",
"slug": "<string>",
"version": "<string>",
"description": "<string>",
"imports": [
"<string>"
]
}
]
}
'import requests
url = "https://api.hightouch.com/api/v1/events/domains"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"events": [
{
"schema": {},
"version": "<string>",
"slug": "<string>",
"name": "<string>"
}
],
"components": [
{
"name": "<string>",
"schema": {},
"id": "<string>",
"slug": "<string>",
"version": "<string>",
"description": "<string>",
"imports": ["<string>"]
}
]
}
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({
name: '<string>',
slug: '<string>',
description: '<string>',
events: [{schema: {}, version: '<string>', slug: '<string>', name: '<string>'}],
components: [
{
name: '<string>',
schema: {},
id: '<string>',
slug: '<string>',
version: '<string>',
description: '<string>',
imports: ['<string>']
}
]
})
};
fetch('https://api.hightouch.com/api/v1/events/domains', 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.hightouch.com/api/v1/events/domains",
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([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'events' => [
[
'schema' => [
],
'version' => '<string>',
'slug' => '<string>',
'name' => '<string>'
]
],
'components' => [
[
'name' => '<string>',
'schema' => [
],
'id' => '<string>',
'slug' => '<string>',
'version' => '<string>',
'description' => '<string>',
'imports' => [
'<string>'
]
]
]
]),
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.hightouch.com/api/v1/events/domains"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n {\n \"schema\": {},\n \"version\": \"<string>\",\n \"slug\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"components\": [\n {\n \"name\": \"<string>\",\n \"schema\": {},\n \"id\": \"<string>\",\n \"slug\": \"<string>\",\n \"version\": \"<string>\",\n \"description\": \"<string>\",\n \"imports\": [\n \"<string>\"\n ]\n }\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.hightouch.com/api/v1/events/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n {\n \"schema\": {},\n \"version\": \"<string>\",\n \"slug\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"components\": [\n {\n \"name\": \"<string>\",\n \"schema\": {},\n \"id\": \"<string>\",\n \"slug\": \"<string>\",\n \"version\": \"<string>\",\n \"description\": \"<string>\",\n \"imports\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hightouch.com/api/v1/events/domains")
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 \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n {\n \"schema\": {},\n \"version\": \"<string>\",\n \"slug\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"components\": [\n {\n \"name\": \"<string>\",\n \"schema\": {},\n \"id\": \"<string>\",\n \"slug\": \"<string>\",\n \"version\": \"<string>\",\n \"description\": \"<string>\",\n \"imports\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"workspaceId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"eventSources": [
{
"name": "<string>",
"id": "<string>"
}
],
"slug": "<string>",
"description": "<string>",
"onUndeclaredSchema": "ALLOW_EVENT",
"schemaVersionPath": [
"<string>"
],
"events": [
{
"schema": {},
"type": "track",
"onUndeclaredFields": "ALLOW_EVENT",
"onSchemaViolation": "ALLOW_EVENT",
"version": "<string>",
"slug": "<string>",
"name": "<string>"
}
],
"components": [
{
"name": "<string>",
"schema": {},
"id": "<string>",
"slug": "<string>",
"version": "<string>",
"description": "<string>",
"imports": [
"<string>"
]
}
]
}{
"message": "Validation failed",
"details": {}
}"Internal Server Error"Create an Event Domain
Create a new event domain, with its events and components.
curl --request POST \
--url https://api.hightouch.com/api/v1/events/domains \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"events": [
{
"schema": {},
"version": "<string>",
"slug": "<string>",
"name": "<string>"
}
],
"components": [
{
"name": "<string>",
"schema": {},
"id": "<string>",
"slug": "<string>",
"version": "<string>",
"description": "<string>",
"imports": [
"<string>"
]
}
]
}
'import requests
url = "https://api.hightouch.com/api/v1/events/domains"
payload = {
"name": "<string>",
"slug": "<string>",
"description": "<string>",
"events": [
{
"schema": {},
"version": "<string>",
"slug": "<string>",
"name": "<string>"
}
],
"components": [
{
"name": "<string>",
"schema": {},
"id": "<string>",
"slug": "<string>",
"version": "<string>",
"description": "<string>",
"imports": ["<string>"]
}
]
}
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({
name: '<string>',
slug: '<string>',
description: '<string>',
events: [{schema: {}, version: '<string>', slug: '<string>', name: '<string>'}],
components: [
{
name: '<string>',
schema: {},
id: '<string>',
slug: '<string>',
version: '<string>',
description: '<string>',
imports: ['<string>']
}
]
})
};
fetch('https://api.hightouch.com/api/v1/events/domains', 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.hightouch.com/api/v1/events/domains",
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([
'name' => '<string>',
'slug' => '<string>',
'description' => '<string>',
'events' => [
[
'schema' => [
],
'version' => '<string>',
'slug' => '<string>',
'name' => '<string>'
]
],
'components' => [
[
'name' => '<string>',
'schema' => [
],
'id' => '<string>',
'slug' => '<string>',
'version' => '<string>',
'description' => '<string>',
'imports' => [
'<string>'
]
]
]
]),
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.hightouch.com/api/v1/events/domains"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n {\n \"schema\": {},\n \"version\": \"<string>\",\n \"slug\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"components\": [\n {\n \"name\": \"<string>\",\n \"schema\": {},\n \"id\": \"<string>\",\n \"slug\": \"<string>\",\n \"version\": \"<string>\",\n \"description\": \"<string>\",\n \"imports\": [\n \"<string>\"\n ]\n }\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.hightouch.com/api/v1/events/domains")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n {\n \"schema\": {},\n \"version\": \"<string>\",\n \"slug\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"components\": [\n {\n \"name\": \"<string>\",\n \"schema\": {},\n \"id\": \"<string>\",\n \"slug\": \"<string>\",\n \"version\": \"<string>\",\n \"description\": \"<string>\",\n \"imports\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hightouch.com/api/v1/events/domains")
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 \"name\": \"<string>\",\n \"slug\": \"<string>\",\n \"description\": \"<string>\",\n \"events\": [\n {\n \"schema\": {},\n \"version\": \"<string>\",\n \"slug\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"components\": [\n {\n \"name\": \"<string>\",\n \"schema\": {},\n \"id\": \"<string>\",\n \"slug\": \"<string>\",\n \"version\": \"<string>\",\n \"description\": \"<string>\",\n \"imports\": [\n \"<string>\"\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"workspaceId": 123,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"eventSources": [
{
"name": "<string>",
"id": "<string>"
}
],
"slug": "<string>",
"description": "<string>",
"onUndeclaredSchema": "ALLOW_EVENT",
"schemaVersionPath": [
"<string>"
],
"events": [
{
"schema": {},
"type": "track",
"onUndeclaredFields": "ALLOW_EVENT",
"onSchemaViolation": "ALLOW_EVENT",
"version": "<string>",
"slug": "<string>",
"name": "<string>"
}
],
"components": [
{
"name": "<string>",
"schema": {},
"id": "<string>",
"slug": "<string>",
"version": "<string>",
"description": "<string>",
"imports": [
"<string>"
]
}
]
}{
"message": "Validation failed",
"details": {}
}"Internal Server Error"Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The input for creating a Domain
The domain's name
The domain's slug. If not specified, one will be generated.
The domain's description
What happens to events that aren't defined in the domain. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT.
ALLOW_EVENT, BLOCK_EVENT The definitions for the events in the domain.
Show child attributes
Show child attributes
The reusable components defined in the domain.
Show child attributes
Show child attributes
Response
Ok
A collection of event and component schemas used for validating events.
The domain's id
The domain's name
The id of the workspace that the domain belongs to
The timestamp when the domain was created
The timestamp when the domain was last updated
The Event Sources linked to the Domain.
Show child attributes
Show child attributes
The domain's slug. If not specified, one will be generated.
The domain's description
What happens to events that aren't defined in the domain. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT.
ALLOW_EVENT, BLOCK_EVENT Path into the event payload where the schema version is read/written. Used by codegen wrappers to inject the version they were generated from.
The definitions for the events in the domain.
Show child attributes
Show child attributes
The reusable components defined in the domain.
Show child attributes
Show child attributes
Was this page helpful?