widget
- Written for
- + Written for
- Deprecated
- + Deprecated
- Applies to
- + Applies to
AdminUpdated Sep 19, 2026
POST
https://api.chatlychat.com/v1/widget/initBootstrap a widget session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
user-agent | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"locale": "string",
"timezone": "string",
"screen": {
"w": 0,
"h": 0,
"d": 0
},
"page": {
"url": "string",
"title": "string",
"faviconUrl": "string"
},
"identity": {
"externalId": "string",
"email": "string",
"phone": "string",
"name": "string",
"userHash": "string",
"attributes": {}
}
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/init" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "user-agent: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0},"page":{"url":"string","title":"string","faviconUrl":"string"},"identity":{"externalId":"string","email":"string","phone":"string","name":"string","userHash":"string","attributes":{}}}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/init', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'user-agent': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0},"page":{"url":"string","title":"string","faviconUrl":"string"},"identity":{"externalId":"string","email":"string","phone":"string","name":"string","userHash":"string","attributes":{}}}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/init",
headers={
"origin": "<value>",
"referer": "<value>",
"user-agent": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "locale": "string", "timezone": "string", "screen": {"w": 0, "h": 0, "d": 0}, "page": {"url": "string", "title": "string", "faviconUrl": "string"}, "identity": {"externalId": "string", "email": "string", "phone": "string", "name": "string", "userHash": "string", "attributes": {}}},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/init", strings.NewReader(`{"publicId":"string","visitorToken":"string","locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0},"page":{"url":"string","title":"string","faviconUrl":"string"},"identity":{"externalId":"string","email":"string","phone":"string","name":"string","userHash":"string","attributes":{}}}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("user-agent", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/init');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'user-agent: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0},"page":{"url":"string","title":"string","faviconUrl":"string"},"identity":{"externalId":"string","email":"string","phone":"string","name":"string","userHash":"string","attributes":{}}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/init')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['user-agent'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0},"page":{"url":"string","title":"string","faviconUrl":"string"},"identity":{"externalId":"string","email":"string","phone":"string","name":"string","userHash":"string","attributes":{}}}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/init"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("user-agent", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"locale\":\"string\",\"timezone\":\"string\",\"screen\":{\"w\":0,\"h\":0,\"d\":0},\"page\":{\"url\":\"string\",\"title\":\"string\",\"faviconUrl\":\"string\"},\"identity\":{\"externalId\":\"string\",\"email\":\"string\",\"phone\":\"string\",\"name\":\"string\",\"userHash\":\"string\",\"attributes\":{}}}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/realtime/tokenMint a short-lived visitor realtime (Socket.IO) token for one conversation
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"conversationId": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/realtime/token" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","conversationId":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/realtime/token', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","conversationId":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/realtime/token",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "conversationId": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/realtime/token", strings.NewReader(`{"publicId":"string","visitorToken":"string","conversationId":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/realtime/token');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","conversationId":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/realtime/token')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","conversationId":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/realtime/token"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"conversationId\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/profileSet, delete or re-locale this visitor’s own attributes
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"set": {},
"remove": [
"string"
],
"locale": "string",
"userHash": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/profile" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","set":{},"remove":["string"],"locale":"string","userHash":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/profile', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","set":{},"remove":["string"],"locale":"string","userHash":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/profile",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "set": {}, "remove": ["string"], "locale": "string", "userHash": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/profile", strings.NewReader(`{"publicId":"string","visitorToken":"string","set":{},"remove":["string"],"locale":"string","userHash":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/profile');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","set":{},"remove":["string"],"locale":"string","userHash":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/profile')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","set":{},"remove":["string"],"locale":"string","userHash":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/profile"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"set\":{},\"remove\":[\"string\"],\"locale\":\"string\",\"userHash\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/conversations/{id}/labelsAdd or remove a label on the visitor’s own conversation
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"action": "add",
"label": "string",
"userHash": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/conversations/{id}/labels" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","action":"add","label":"string","userHash":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/conversations/{id}/labels', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","action":"add","label":"string","userHash":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/conversations/{id}/labels",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "action": "add", "label": "string", "userHash": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/conversations/{id}/labels", strings.NewReader(`{"publicId":"string","visitorToken":"string","action":"add","label":"string","userHash":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/conversations/{id}/labels');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","action":"add","label":"string","userHash":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/conversations/{id}/labels')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","action":"add","label":"string","userHash":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/conversations/{id}/labels"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"action\":\"add\",\"label\":\"string\",\"userHash\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/conversationsStart a new conversation from the widget
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
user-agent | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"body": "",
"attachments": [],
"preChat": {},
"pageContext": {
"page_url_at_open": "string",
"referrer_url": "string",
"browser": "string",
"os": "string",
"device_type": "string",
"utm_source": "string",
"utm_medium": "string",
"utm_campaign": "string",
"utm_content": "string",
"utm_term": "string"
},
"locale": "string",
"timezone": "string",
"screen": {
"w": 0,
"h": 0,
"d": 0
}
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/conversations" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "user-agent: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","body":"","attachments":[],"preChat":{},"pageContext":{"page_url_at_open":"string","referrer_url":"string","browser":"string","os":"string","device_type":"string","utm_source":"string","utm_medium":"string","utm_campaign":"string","utm_content":"string","utm_term":"string"},"locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0}}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/conversations', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'user-agent': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","body":"","attachments":[],"preChat":{},"pageContext":{"page_url_at_open":"string","referrer_url":"string","browser":"string","os":"string","device_type":"string","utm_source":"string","utm_medium":"string","utm_campaign":"string","utm_content":"string","utm_term":"string"},"locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0}}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/conversations",
headers={
"origin": "<value>",
"referer": "<value>",
"user-agent": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "body": "", "attachments": [], "preChat": {}, "pageContext": {"page_url_at_open": "string", "referrer_url": "string", "browser": "string", "os": "string", "device_type": "string", "utm_source": "string", "utm_medium": "string", "utm_campaign": "string", "utm_content": "string", "utm_term": "string"}, "locale": "string", "timezone": "string", "screen": {"w": 0, "h": 0, "d": 0}},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/conversations", strings.NewReader(`{"visitorToken":"string","publicId":"string","body":"","attachments":[],"preChat":{},"pageContext":{"page_url_at_open":"string","referrer_url":"string","browser":"string","os":"string","device_type":"string","utm_source":"string","utm_medium":"string","utm_campaign":"string","utm_content":"string","utm_term":"string"},"locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0}}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("user-agent", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/conversations');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'user-agent: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","body":"","attachments":[],"preChat":{},"pageContext":{"page_url_at_open":"string","referrer_url":"string","browser":"string","os":"string","device_type":"string","utm_source":"string","utm_medium":"string","utm_campaign":"string","utm_content":"string","utm_term":"string"},"locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/conversations')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['user-agent'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","body":"","attachments":[],"preChat":{},"pageContext":{"page_url_at_open":"string","referrer_url":"string","browser":"string","os":"string","device_type":"string","utm_source":"string","utm_medium":"string","utm_campaign":"string","utm_content":"string","utm_term":"string"},"locale":"string","timezone":"string","screen":{"w":0,"h":0,"d":0}}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/conversations"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("user-agent", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"body\":\"\",\"attachments\":[],\"preChat\":{},\"pageContext\":{\"page_url_at_open\":\"string\",\"referrer_url\":\"string\",\"browser\":\"string\",\"os\":\"string\",\"device_type\":\"string\",\"utm_source\":\"string\",\"utm_medium\":\"string\",\"utm_campaign\":\"string\",\"utm_content\":\"string\",\"utm_term\":\"string\"},\"locale\":\"string\",\"timezone\":\"string\",\"screen\":{\"w\":0,\"h\":0,\"d\":0}}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/messagesSend a follow-up message from the widget
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"conversationId": "string",
"body": "",
"attachments": []
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/messages" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","conversationId":"string","body":"","attachments":[]}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/messages', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","conversationId":"string","body":"","attachments":[]}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/messages",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "conversationId": "string", "body": "", "attachments": []},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/messages", strings.NewReader(`{"visitorToken":"string","publicId":"string","conversationId":"string","body":"","attachments":[]}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/messages');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","conversationId":"string","body":"","attachments":[]}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/messages')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","conversationId":"string","body":"","attachments":[]}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/messages"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"conversationId\":\"string\",\"body\":\"\",\"attachments\":[]}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/conversations/listList the visitor’s own conversations (for the history tab)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"limit": 0
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/conversations/list" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","limit":0}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/conversations/list', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","limit":0}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/conversations/list",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "limit": 0},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/conversations/list", strings.NewReader(`{"publicId":"string","visitorToken":"string","limit":0}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/conversations/list');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","limit":0}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/conversations/list')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","limit":0}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/conversations/list"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"limit\":0}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/messages/listList messages for one of the visitor’s conversations
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"conversationId": "string",
"limit": 0
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/messages/list" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","conversationId":"string","limit":0}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/messages/list', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","conversationId":"string","limit":0}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/messages/list",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "conversationId": "string", "limit": 0},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/messages/list", strings.NewReader(`{"publicId":"string","visitorToken":"string","conversationId":"string","limit":0}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/messages/list');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","conversationId":"string","limit":0}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/messages/list')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","conversationId":"string","limit":0}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/messages/list"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"conversationId\":\"string\",\"limit\":0}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/conversations/{id}/escalateHand the conversation off to a human — clears the assignee, stamps routed_at, and fires conversation.escalated
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"reason": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/conversations/{id}/escalate" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","reason":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/conversations/{id}/escalate', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","reason":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/conversations/{id}/escalate",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "reason": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/conversations/{id}/escalate", strings.NewReader(`{"publicId":"string","visitorToken":"string","reason":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/conversations/{id}/escalate');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","reason":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/conversations/{id}/escalate')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","reason":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/conversations/{id}/escalate"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"reason\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolvedRecord an "AI answered my question" confirmation — feeds the deflection-funnel report
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | yes | |
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"messageId": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","messageId":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","messageId":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "messageId": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved", strings.NewReader(`{"publicId":"string","visitorToken":"string","messageId":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","messageId":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","messageId":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/conversations/{id}/ai-resolved"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"messageId\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/cobrowse/respondAccept or decline an agent co-browse request
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"conversationId": "string",
"sessionId": "string",
"accepted": true
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/cobrowse/respond" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","conversationId":"string","sessionId":"string","accepted":true}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/cobrowse/respond', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","conversationId":"string","sessionId":"string","accepted":true}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/cobrowse/respond",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "conversationId": "string", "sessionId": "string", "accepted": True},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/cobrowse/respond", strings.NewReader(`{"publicId":"string","visitorToken":"string","conversationId":"string","sessionId":"string","accepted":true}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/cobrowse/respond');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","conversationId":"string","sessionId":"string","accepted":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/cobrowse/respond')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","conversationId":"string","sessionId":"string","accepted":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/cobrowse/respond"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"conversationId\":\"string\",\"sessionId\":\"string\",\"accepted\":true}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/uploads/presignPresign an upload for a widget visitor
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"filename": "string",
"contentType": "string",
"sizeBytes": 0
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/uploads/presign" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","filename":"string","contentType":"string","sizeBytes":0}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/uploads/presign', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","filename":"string","contentType":"string","sizeBytes":0}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/uploads/presign",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "filename": "string", "contentType": "string", "sizeBytes": 0},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/uploads/presign", strings.NewReader(`{"visitorToken":"string","publicId":"string","filename":"string","contentType":"string","sizeBytes":0}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/uploads/presign');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","filename":"string","contentType":"string","sizeBytes":0}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/uploads/presign')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","filename":"string","contentType":"string","sizeBytes":0}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/uploads/presign"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"filename\":\"string\",\"contentType\":\"string\",\"sizeBytes\":0}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/transcriptEmail this visitor a transcript of their conversation
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"conversationId": "string",
"email": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/transcript" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","conversationId":"string","email":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/transcript', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","conversationId":"string","email":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/transcript",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "conversationId": "string", "email": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/transcript", strings.NewReader(`{"visitorToken":"string","publicId":"string","conversationId":"string","email":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/transcript');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","conversationId":"string","email":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/transcript')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","conversationId":"string","email":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/transcript"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"conversationId\":\"string\",\"email\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/eventsTrack a visitor event (widget)
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"name": "string",
"properties": {}
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/events" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","name":"string","properties":{}}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/events', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","name":"string","properties":{}}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/events",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "name": "string", "properties": {}},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/events", strings.NewReader(`{"visitorToken":"string","publicId":"string","name":"string","properties":{}}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/events');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","name":"string","properties":{}}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/events')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","name":"string","properties":{}}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/events"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"name\":\"string\",\"properties\":{}}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/csatSubmit a satisfaction score for a conversation
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"conversationId": "string",
"score": 0,
"comment": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/csat" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","conversationId":"string","score":0,"comment":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/csat', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","conversationId":"string","score":0,"comment":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/csat",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "conversationId": "string", "score": 0, "comment": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/csat", strings.NewReader(`{"visitorToken":"string","publicId":"string","conversationId":"string","score":0,"comment":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/csat');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","conversationId":"string","score":0,"comment":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/csat')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","conversationId":"string","score":0,"comment":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/csat"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"conversationId\":\"string\",\"score\":0,\"comment\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/csat/commentAttach a comment to a satisfaction score already given
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"conversationId": "string",
"responseId": "string",
"comment": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/csat/comment" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","conversationId":"string","responseId":"string","comment":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/csat/comment', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","conversationId":"string","responseId":"string","comment":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/csat/comment",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "conversationId": "string", "responseId": "string", "comment": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/csat/comment", strings.NewReader(`{"visitorToken":"string","publicId":"string","conversationId":"string","responseId":"string","comment":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/csat/comment');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","conversationId":"string","responseId":"string","comment":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/csat/comment')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","conversationId":"string","responseId":"string","comment":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/csat/comment"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"conversationId\":\"string\",\"responseId\":\"string\",\"comment\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/video-calls/tokenMint a LiveKit token for a widget video call
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"conversationId": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/video-calls/token" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","conversationId":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/video-calls/token', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","conversationId":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/video-calls/token",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "conversationId": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/video-calls/token", strings.NewReader(`{"visitorToken":"string","publicId":"string","conversationId":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/video-calls/token');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","conversationId":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/video-calls/token')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","conversationId":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/video-calls/token"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"conversationId\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/video-calls/endSignal that the visitor ended the video call
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"visitorToken": "string",
"publicId": "string",
"conversationId": "string",
"reason": "hangup"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/video-calls/end" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"visitorToken":"string","publicId":"string","conversationId":"string","reason":"hangup"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/video-calls/end', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"visitorToken":"string","publicId":"string","conversationId":"string","reason":"hangup"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/video-calls/end",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"visitorToken": "string", "publicId": "string", "conversationId": "string", "reason": "hangup"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/video-calls/end", strings.NewReader(`{"visitorToken":"string","publicId":"string","conversationId":"string","reason":"hangup"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/video-calls/end');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"visitorToken":"string","publicId":"string","conversationId":"string","reason":"hangup"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/video-calls/end')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"visitorToken":"string","publicId":"string","conversationId":"string","reason":"hangup"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/video-calls/end"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"visitorToken\":\"string\",\"publicId\":\"string\",\"conversationId\":\"string\",\"reason\":\"hangup\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/push/registerRegister a device push token against the current widget visitor
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"platform": "apns",
"token": "string",
"appVersion": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/push/register" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","platform":"apns","token":"string","appVersion":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/push/register', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","platform":"apns","token":"string","appVersion":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/push/register",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "platform": "apns", "token": "string", "appVersion": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/push/register", strings.NewReader(`{"publicId":"string","visitorToken":"string","platform":"apns","token":"string","appVersion":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/push/register');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","platform":"apns","token":"string","appVersion":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/push/register')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","platform":"apns","token":"string","appVersion":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/push/register"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"platform\":\"apns\",\"token\":\"string\",\"appVersion\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/kb/searchSearch the workspace knowledge base from the widget
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"query": "",
"limit": 0,
"locale": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/kb/search" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","query":"","limit":0,"locale":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/kb/search', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","query":"","limit":0,"locale":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/kb/search",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "query": "", "limit": 0, "locale": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/kb/search", strings.NewReader(`{"publicId":"string","visitorToken":"string","query":"","limit":0,"locale":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/kb/search');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","query":"","limit":0,"locale":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/kb/search')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","query":"","limit":0,"locale":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/kb/search"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"query\":\"\",\"limit\":0,\"locale\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());POST
https://api.chatlychat.com/v1/widget/kb/articleFetch the full body of a published KB article
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
origin | header | string | yes | |
referer | header | string | yes | |
Idempotency-Key | header | string | no | UUIDv4 or 16-128 char opaque token. Required on write endpoints in production. Replays return the cached response with `Idempotency-Replay: true`; reusing the key with a different body returns 409 idempotency_conflict. |
Request body application/json
{
"publicId": "string",
"visitorToken": "string",
"slug": "string"
}Responses
201
Code samples
cURL
curl -X POST "https://api.chatlychat.com/v1/widget/kb/article" \
-H "origin: <value>" \
-H "referer: <value>" \
-H "Idempotency-Key: <value>" \
-H "Content-Type: application/json" \
-d '{"publicId":"string","visitorToken":"string","slug":"string"}'TypeScript
const res = await fetch('https://api.chatlychat.com/v1/widget/kb/article', {
method: 'POST',
headers: {
'origin': '<value>',
'referer': '<value>',
'Idempotency-Key': '<value>',
'Content-Type': 'application/json',
},
body: JSON.stringify({"publicId":"string","visitorToken":"string","slug":"string"}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://api.chatlychat.com/v1/widget/kb/article",
headers={
"origin": "<value>",
"referer": "<value>",
"Idempotency-Key": "<value>",
"Content-Type": "application/json",
},
json={"publicId": "string", "visitorToken": "string", "slug": "string"},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://api.chatlychat.com/v1/widget/kb/article", strings.NewReader(`{"publicId":"string","visitorToken":"string","slug":"string"}`))
req.Header.Set("origin", "<value>")
req.Header.Set("referer", "<value>")
req.Header.Set("Idempotency-Key", "<value>")
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.chatlychat.com/v1/widget/kb/article');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['origin: <value>', 'referer: <value>', 'Idempotency-Key: <value>', 'Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"publicId":"string","visitorToken":"string","slug":"string"}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://api.chatlychat.com/v1/widget/kb/article')
req = Net::HTTP::Post.new(uri)
req['origin'] = '<value>'
req['referer'] = '<value>'
req['Idempotency-Key'] = '<value>'
req['Content-Type'] = 'application/json'
req.body = '{"publicId":"string","visitorToken":"string","slug":"string"}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.chatlychat.com/v1/widget/kb/article"))
.header("origin", "<value>")
.header("referer", "<value>")
.header("Idempotency-Key", "<value>")
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"publicId\":\"string\",\"visitorToken\":\"string\",\"slug\":\"string\"}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Was this page helpful?