Create a webhook
curl --request POST \
--url https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--header 'api_account_id: <api-key>' \
--data '
{
"webhook": {
"url": "https://api.yourcompany.com/domix-events",
"subscriptions": [
"conversation_created",
"conversation_status_changed",
"message_created",
"message_updated",
"contact_created"
]
}
}
'import requests
url = "https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks"
payload = { "webhook": {
"url": "https://api.yourcompany.com/domix-events",
"subscriptions": ["conversation_created", "conversation_status_changed", "message_created", "message_updated", "contact_created"]
} }
headers = {
"api_access_token": "<api-key>",
"api_account_id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
api_access_token: '<api-key>',
api_account_id: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook: {
url: 'https://api.yourcompany.com/domix-events',
subscriptions: [
'conversation_created',
'conversation_status_changed',
'message_created',
'message_updated',
'contact_created'
]
}
})
};
fetch('https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks', 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://chat.domix.ai/api/v1/accounts/{account_id}/webhooks",
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([
'webhook' => [
'url' => 'https://api.yourcompany.com/domix-events',
'subscriptions' => [
'conversation_created',
'conversation_status_changed',
'message_created',
'message_updated',
'contact_created'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>",
"api_account_id: <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://chat.domix.ai/api/v1/accounts/{account_id}/webhooks"
payload := strings.NewReader("{\n \"webhook\": {\n \"url\": \"https://api.yourcompany.com/domix-events\",\n \"subscriptions\": [\n \"conversation_created\",\n \"conversation_status_changed\",\n \"message_created\",\n \"message_updated\",\n \"contact_created\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_access_token", "<api-key>")
req.Header.Add("api_account_id", "<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://chat.domix.ai/api/v1/accounts/{account_id}/webhooks")
.header("api_access_token", "<api-key>")
.header("api_account_id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook\": {\n \"url\": \"https://api.yourcompany.com/domix-events\",\n \"subscriptions\": [\n \"conversation_created\",\n \"conversation_status_changed\",\n \"message_created\",\n \"message_updated\",\n \"contact_created\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["api_account_id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook\": {\n \"url\": \"https://api.yourcompany.com/domix-events\",\n \"subscriptions\": [\n \"conversation_created\",\n \"conversation_status_changed\",\n \"message_created\",\n \"message_updated\",\n \"contact_created\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 10,
"url": "https://api.yourcompany.com/domix-events",
"account_id": 16,
"subscriptions": [
"message_created",
"conversation_created"
]
}Real-Time Webhooks
Create a webhook
Register a new webhook URL to receive real-time POST events (messages, conversations, contacts).
POST
https://chat.domix.ai
/
api
/
v1
/
accounts
/
{account_id}
/
webhooks
Create a webhook
curl --request POST \
--url https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--header 'api_account_id: <api-key>' \
--data '
{
"webhook": {
"url": "https://api.yourcompany.com/domix-events",
"subscriptions": [
"conversation_created",
"conversation_status_changed",
"message_created",
"message_updated",
"contact_created"
]
}
}
'import requests
url = "https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks"
payload = { "webhook": {
"url": "https://api.yourcompany.com/domix-events",
"subscriptions": ["conversation_created", "conversation_status_changed", "message_created", "message_updated", "contact_created"]
} }
headers = {
"api_access_token": "<api-key>",
"api_account_id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
api_access_token: '<api-key>',
api_account_id: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
webhook: {
url: 'https://api.yourcompany.com/domix-events',
subscriptions: [
'conversation_created',
'conversation_status_changed',
'message_created',
'message_updated',
'contact_created'
]
}
})
};
fetch('https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks', 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://chat.domix.ai/api/v1/accounts/{account_id}/webhooks",
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([
'webhook' => [
'url' => 'https://api.yourcompany.com/domix-events',
'subscriptions' => [
'conversation_created',
'conversation_status_changed',
'message_created',
'message_updated',
'contact_created'
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"api_access_token: <api-key>",
"api_account_id: <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://chat.domix.ai/api/v1/accounts/{account_id}/webhooks"
payload := strings.NewReader("{\n \"webhook\": {\n \"url\": \"https://api.yourcompany.com/domix-events\",\n \"subscriptions\": [\n \"conversation_created\",\n \"conversation_status_changed\",\n \"message_created\",\n \"message_updated\",\n \"contact_created\"\n ]\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("api_access_token", "<api-key>")
req.Header.Add("api_account_id", "<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://chat.domix.ai/api/v1/accounts/{account_id}/webhooks")
.header("api_access_token", "<api-key>")
.header("api_account_id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"webhook\": {\n \"url\": \"https://api.yourcompany.com/domix-events\",\n \"subscriptions\": [\n \"conversation_created\",\n \"conversation_status_changed\",\n \"message_created\",\n \"message_updated\",\n \"contact_created\"\n ]\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://chat.domix.ai/api/v1/accounts/{account_id}/webhooks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["api_access_token"] = '<api-key>'
request["api_account_id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"webhook\": {\n \"url\": \"https://api.yourcompany.com/domix-events\",\n \"subscriptions\": [\n \"conversation_created\",\n \"conversation_status_changed\",\n \"message_created\",\n \"message_updated\",\n \"contact_created\"\n ]\n }\n}"
response = http.request(request)
puts response.read_body{
"id": 10,
"url": "https://api.yourcompany.com/domix-events",
"account_id": 16,
"subscriptions": [
"message_created",
"conversation_created"
]
}Authorizations
ApiAccessToken & ApiAccountIdApiAccessTokenHyphen & ApiAccountIdHyphen
API Access Token (underscore format)
Account ID (underscore format for unified message endpoints)
Path Parameters
ID of the account in Domix AI
Example:
"16"
Body
application/json