Chat Domains

Base URL: https://api.cornerspot.net

Authentication: requests use a bearer token, for example Authorization: Bearer YOUR_API_KEY.

List chat domains

GET /c/api/v1/chat_domains

Returns a paginated list of the team's allowed chat-widget embedding domains. Requires chat_read scope and the Live Chat module.

Query parameters

FIELDTYPEDESCRIPTION
querystringSearch term matched against hostname.
filter[enabled]stringFilter by enabled status: true or false.
sortstringSort column, - prefix for descending. One of hostname, enabled, created_at, updated_at. Default hostname.
pageinteger1-based page number.
per_pageintegerPage size (1–100, default 25).

Code samples

curl --request GET \
  --url 'https://api.cornerspot.net/c/api/v1/chat_domains' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

const data = await response.json();
console.log(data);
// Node.js 18+ (native fetch)
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
import json
import urllib.request

url = "https://api.cornerspot.net/c/api/v1/chat_domains"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
}

request = urllib.request.Request(url, headers=headers, method="GET")

with urllib.request.urlopen(request) as response:
    data = json.loads(response.read().decode("utf-8"))
    print(data)
require "json"
require "net/http"

uri = URI("https://api.cornerspot.net/c/api/v1/chat_domains")

request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.cornerspot.net/c/api/v1/chat_domains',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_API_KEY',
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response, true);
print_r($data);

Responses

STATUSDESCRIPTION
200 OKa page of chat domains
401 Unauthorizedmissing or invalid API key
402 Payment Requiredthe team's plan doesn't include the Live Chat module
403 Forbiddenthe key lacks the chat_read scope

Create a chat domain

POST /c/api/v1/chat_domains

Adds a hostname to the team's live-chat embedding allowlist. Requires chat_write scope and the Live Chat module.

Request body

FIELDTYPEDESCRIPTION
chat_domainobject
chat_domain.hostnamestring · requiredRequired — the hostname to whitelist (no scheme, no path).
chat_domain.include_subdomainsbooleanWhen true, all subdomains of hostname are also whitelisted.
chat_domain.enabledbooleanWhether this entry should be immediately active (default true).
chat_domain.notestringOptional operator note.

Code samples

curl --request POST \
  --url 'https://api.cornerspot.net/c/api/v1/chat_domains' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "chat_domain": {
    "hostname": "string",
    "include_subdomains": true,
    "enabled": true,
    "note": "string"
  }
}'
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    "chat_domain": {
      "hostname": "string",
      "include_subdomains": true,
      "enabled": true,
      "note": "string"
    }
  })
});

const data = await response.json();
console.log(data);
// Node.js 18+ (native fetch)
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    "chat_domain": {
      "hostname": "string",
      "include_subdomains": true,
      "enabled": true,
      "note": "string"
    }
  })
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
import json
import urllib.request

url = "https://api.cornerspot.net/c/api/v1/chat_domains"
payload = json.dumps({
  "chat_domain": {
    "hostname": "string",
    "include_subdomains": true,
    "enabled": true,
    "note": "string"
  }
}).encode("utf-8")
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY",
}

request = urllib.request.Request(url, data=payload, headers=headers, method="POST")

with urllib.request.urlopen(request) as response:
    data = json.loads(response.read().decode("utf-8"))
    print(data)
require "json"
require "net/http"

uri = URI("https://api.cornerspot.net/c/api/v1/chat_domains")

request = Net::HTTP::Post.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer YOUR_API_KEY"
request.body = JSON.generate({
  "chat_domain": {
    "hostname": "string",
    "include_subdomains": true,
    "enabled": true,
    "note": "string"
  }
})

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.cornerspot.net/c/api/v1/chat_domains',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'Authorization: Bearer YOUR_API_KEY',
    ],
    CURLOPT_POSTFIELDS => json_encode([
    'chat_domain' => [
        'hostname' => 'string',
        'include_subdomains' => true,
        'enabled' => true,
        'note' => 'string',
    ],
]),
]);

$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response, true);
print_r($data);

Responses

STATUSDESCRIPTION
201 Createdcreated
401 Unauthorizedmissing or invalid API key
402 Payment Requiredthe team's plan doesn't include the Live Chat module
403 Forbiddenthe key lacks the chat_write scope
422 Unprocessable Contentvalidation errors (e.g. blank or invalid hostname)

Get a chat domain

GET /c/api/v1/chat_domains/{id}

Path parameters

FIELDTYPEDESCRIPTION
idstring · requiredChat domain id.

Code samples

curl --request GET \
  --url 'https://api.cornerspot.net/c/api/v1/chat_domains/abc123' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains/abc123', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

const data = await response.json();
console.log(data);
// Node.js 18+ (native fetch)
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains/abc123', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
import json
import urllib.request

url = "https://api.cornerspot.net/c/api/v1/chat_domains/abc123"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
}

request = urllib.request.Request(url, headers=headers, method="GET")

with urllib.request.urlopen(request) as response:
    data = json.loads(response.read().decode("utf-8"))
    print(data)
require "json"
require "net/http"

uri = URI("https://api.cornerspot.net/c/api/v1/chat_domains/abc123")

request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.cornerspot.net/c/api/v1/chat_domains/abc123',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_API_KEY',
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response, true);
print_r($data);

Responses

STATUSDESCRIPTION
200 OKthe chat domain
401 Unauthorizedmissing or invalid API key
402 Payment Requiredthe team's plan doesn't include the Live Chat module
403 Forbiddenthe key lacks the chat_read scope
404 Not Foundno such chat domain in this team

Update a chat domain

PATCH /c/api/v1/chat_domains/{id}

Updates the hostname entry. Any subset of permitted attributes may be sent.

Path parameters

FIELDTYPEDESCRIPTION
idstring · requiredChat domain id.

Request body

FIELDTYPEDESCRIPTION
chat_domainobject
chat_domain.hostnamestring
chat_domain.include_subdomainsboolean
chat_domain.enabledboolean
chat_domain.notestring

Code samples

curl --request PATCH \
  --url 'https://api.cornerspot.net/c/api/v1/chat_domains/abc123' \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --data '{
  "chat_domain": {
    "hostname": "string",
    "include_subdomains": true,
    "enabled": true,
    "note": "string"
  }
}'
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains/abc123', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    "chat_domain": {
      "hostname": "string",
      "include_subdomains": true,
      "enabled": true,
      "note": "string"
    }
  })
});

const data = await response.json();
console.log(data);
// Node.js 18+ (native fetch)
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains/abc123', {
  method: 'PATCH',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    "chat_domain": {
      "hostname": "string",
      "include_subdomains": true,
      "enabled": true,
      "note": "string"
    }
  })
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
import json
import urllib.request

url = "https://api.cornerspot.net/c/api/v1/chat_domains/abc123"
payload = json.dumps({
  "chat_domain": {
    "hostname": "string",
    "include_subdomains": true,
    "enabled": true,
    "note": "string"
  }
}).encode("utf-8")
headers = {
    "Content-Type": "application/json",
    "Authorization": "Bearer YOUR_API_KEY",
}

request = urllib.request.Request(url, data=payload, headers=headers, method="PATCH")

with urllib.request.urlopen(request) as response:
    data = json.loads(response.read().decode("utf-8"))
    print(data)
require "json"
require "net/http"

uri = URI("https://api.cornerspot.net/c/api/v1/chat_domains/abc123")

request = Net::HTTP::Patch.new(uri)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer YOUR_API_KEY"
request.body = JSON.generate({
  "chat_domain": {
    "hostname": "string",
    "include_subdomains": true,
    "enabled": true,
    "note": "string"
  }
})

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.cornerspot.net/c/api/v1/chat_domains/abc123',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        'Authorization: Bearer YOUR_API_KEY',
    ],
    CURLOPT_POSTFIELDS => json_encode([
    'chat_domain' => [
        'hostname' => 'string',
        'include_subdomains' => true,
        'enabled' => true,
        'note' => 'string',
    ],
]),
]);

$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response, true);
print_r($data);

Responses

STATUSDESCRIPTION
200 OKupdated
401 Unauthorizedmissing or invalid API key
402 Payment Requiredthe team's plan doesn't include the Live Chat module
403 Forbiddenthe key lacks the chat_write scope
404 Not Foundno such chat domain in this team
422 Unprocessable Contentvalidation errors (e.g. invalid hostname format)

Delete a chat domain

DELETE /c/api/v1/chat_domains/{id}

Permanently removes the hostname from the team's embedding allowlist.

Path parameters

FIELDTYPEDESCRIPTION
idstring · requiredChat domain id.

Code samples

curl --request DELETE \
  --url 'https://api.cornerspot.net/c/api/v1/chat_domains/abc123' \
  --header 'Authorization: Bearer YOUR_API_KEY'
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains/abc123', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

const data = await response.json();
console.log(data);
// Node.js 18+ (native fetch)
const response = await fetch('https://api.cornerspot.net/c/api/v1/chat_domains/abc123', {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);
import json
import urllib.request

url = "https://api.cornerspot.net/c/api/v1/chat_domains/abc123"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
}

request = urllib.request.Request(url, headers=headers, method="DELETE")

with urllib.request.urlopen(request) as response:
    data = json.loads(response.read().decode("utf-8"))
    print(data)
require "json"
require "net/http"

uri = URI("https://api.cornerspot.net/c/api/v1/chat_domains/abc123")

request = Net::HTTP::Delete.new(uri)
request["Authorization"] = "Bearer YOUR_API_KEY"

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end

puts JSON.parse(response.body)
<?php

$curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => 'https://api.cornerspot.net/c/api/v1/chat_domains/abc123',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'DELETE',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer YOUR_API_KEY',
    ],
]);

$response = curl_exec($curl);
curl_close($curl);

$data = json_decode($response, true);
print_r($data);

Responses

STATUSDESCRIPTION
204 No Contentdeleted
401 Unauthorizedmissing or invalid API key
402 Payment Requiredthe team's plan doesn't include the Live Chat module
403 Forbiddenthe key lacks the chat_write scope
404 Not Foundno such chat domain in this team

Was this article helpful?