Start a live chat session
curl --request POST \
--url https://my.server.express/api/v1/livechat/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "<string>",
"firstMessage": "<string>",
"existingThreadId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: '<string>',
firstMessage: '<string>',
existingThreadId: '<string>'
})
};
fetch('https://my.server.express/api/v1/livechat/start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/livechat/start"
payload = {
"name": "<string>",
"email": "<string>",
"firstMessage": "<string>",
"existingThreadId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"sessionId": "<string>",
"threadId": "<string>",
"wsUrl": "<string>",
"identity": {
"name": "<string>",
"email": "<string>",
"userId": "<string>"
}
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Livechat
Start a live chat session
Opens a live chat bridged to a Discord thread and returns a WebSocket URL to connect to. Works signed in or anonymous. If an Authorization header is sent it must be a valid session (otherwise 401), and the account’s name and email override whatever the body says. Anonymous visitors must send a name. Passing existingThreadId for a thread whose session was lost (say, after a restart) resumes on that thread instead of opening a new one. 503 while the Discord bot isn’t configured or is still connecting.
POST
/
v1
/
livechat
/
start
Start a live chat session
curl --request POST \
--url https://my.server.express/api/v1/livechat/start \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"email": "<string>",
"firstMessage": "<string>",
"existingThreadId": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
email: '<string>',
firstMessage: '<string>',
existingThreadId: '<string>'
})
};
fetch('https://my.server.express/api/v1/livechat/start', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://my.server.express/api/v1/livechat/start"
payload = {
"name": "<string>",
"email": "<string>",
"firstMessage": "<string>",
"existingThreadId": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"success": true,
"data": {
"sessionId": "<string>",
"threadId": "<string>",
"wsUrl": "<string>",
"identity": {
"name": "<string>",
"email": "<string>",
"userId": "<string>"
}
}
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}{
"success": false,
"error": "<string>"
}Authorizations
Session access token (JWT) from POST /v1/auth/login or /v1/auth/refresh. A session satisfies every API scope.
Body
application/json