curl --request POST \
--url https://accounts.livechat.com/v2/organizations/{organization_id}/domains \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "text.com"
}
'import requests
url = "https://accounts.livechat.com/v2/organizations/{organization_id}/domains"
payload = { "domain": "text.com" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'text.com'})
};
fetch('https://accounts.livechat.com/v2/organizations/{organization_id}/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://accounts.livechat.com/v2/organizations/{organization_id}/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([
'domain' => 'text.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://accounts.livechat.com/v2/organizations/{organization_id}/domains"
payload := strings.NewReader("{\n \"domain\": \"text.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://accounts.livechat.com/v2/organizations/{organization_id}/domains")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"text.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://accounts.livechat.com/v2/organizations/{organization_id}/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"text.com\"\n}"
response = http.request(request)
puts response.read_body{
"organization_id": "b2185556-634c-4ecf-b4c9-bcf8b65bc853",
"domain_id": "e4f1235b-0e43-4b79-ae40-3ea56e53bb3a",
"domain": "text.com",
"type": "open",
"created_at": "2026-06-03T10:53:04.000Z"
}{
"error": "unauthorized",
"error_description": "The account is not authorized.",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "resource_not_found",
"error_description": "The requested resource couldn't be found.",
"resource_name": "account",
"resource_id": "def31e95-5ca4-4817-b176-732e4544daca",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "conflict",
"error_description": "The request couldn't be processed because of conflict in the current state of the resource.",
"resource_name": "account",
"resource_id": "5903c51b-89f0-41a9-a25d-4f39af100353",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "invalid_request",
"error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.",
"invalid_fields": {
"email": "invalid email address"
},
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "server_error",
"error_description": "The server encountered an unexpected condition that prevented it from fulfilling the request.",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}Create organization domain
Adds a new domain to the organization’s email address domain whitelist.
It’s forbidden to add domains used for disposable email addresses or used by free email providers. Maximum number of domains added to an organization is 10.
curl --request POST \
--url https://accounts.livechat.com/v2/organizations/{organization_id}/domains \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '
{
"domain": "text.com"
}
'import requests
url = "https://accounts.livechat.com/v2/organizations/{organization_id}/domains"
payload = { "domain": "text.com" }
headers = {
"Authorization": "Basic <encoded-value>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({domain: 'text.com'})
};
fetch('https://accounts.livechat.com/v2/organizations/{organization_id}/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://accounts.livechat.com/v2/organizations/{organization_id}/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([
'domain' => 'text.com'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>",
"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://accounts.livechat.com/v2/organizations/{organization_id}/domains"
payload := strings.NewReader("{\n \"domain\": \"text.com\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Basic <encoded-value>")
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://accounts.livechat.com/v2/organizations/{organization_id}/domains")
.header("Authorization", "Basic <encoded-value>")
.header("Content-Type", "application/json")
.body("{\n \"domain\": \"text.com\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://accounts.livechat.com/v2/organizations/{organization_id}/domains")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Basic <encoded-value>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"domain\": \"text.com\"\n}"
response = http.request(request)
puts response.read_body{
"organization_id": "b2185556-634c-4ecf-b4c9-bcf8b65bc853",
"domain_id": "e4f1235b-0e43-4b79-ae40-3ea56e53bb3a",
"domain": "text.com",
"type": "open",
"created_at": "2026-06-03T10:53:04.000Z"
}{
"error": "unauthorized",
"error_description": "The account is not authorized.",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "resource_not_found",
"error_description": "The requested resource couldn't be found.",
"resource_name": "account",
"resource_id": "def31e95-5ca4-4817-b176-732e4544daca",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "conflict",
"error_description": "The request couldn't be processed because of conflict in the current state of the resource.",
"resource_name": "account",
"resource_id": "5903c51b-89f0-41a9-a25d-4f39af100353",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "invalid_request",
"error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.",
"invalid_fields": {
"email": "invalid email address"
},
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}{
"error": "server_error",
"error_description": "The server encountered an unexpected condition that prevented it from fulfilling the request.",
"request_id": "5903c51b-89f0-41a9-a25d-4f39af100353"
}Authorizations
Use your account ID as the username and your personal access token (PAT) as the password, or pass a Base64-encoded value directly in the Authorization header. For more information, see the personal access tokens guide.
Path Parameters
Unique organization ID. Unique organization identifier.
Body
The parameters for creating an organization domain.
The domain name.
Response
Created: Returns created organization domain.
Organization domain.
Unique organization identifier.
Unique domain identifier.
The domain name.
Type of the domain assigned to the organization. Only one type is available - open. Open domains are email domains that are able to join a given organization without additional confirmation.
The creation date of the organization domain.
Was this page helpful?