Skip to content

API reference

API: Website chat

Markdown version

MethodPathWhat it doesScope
GET/v1/inbound/avatarThe video avatar's setup: whether the organization's Anam key is saved and Anam's browser SDK is installed (and its version)settings:read
PUT/v1/inbound/avatarSave (or with null remove) the organization's own Anam API key for the video avatar (owners). It's kept encrypted, used only on our server to mint short session tokens, and never shown again (web app only)settings:write
GET/v1/inbound/chatsWebsite chats, newest first (status: waiting for a person, with a person, the agent's, closed)inbound:read
GET/v1/inbound/chats/:idA website chat: messages with citations, the visitor, flags and qualificationinbound:read
POST/v1/inbound/chats/:id/closeClose a chatinbound:write
POST/v1/inbound/chats/:id/hand-backGive the chat back to the agent (it answers the visitor again)messages:send
POST/v1/inbound/chats/:id/replyReply to the visitor as yourself (takes the chat over from the agent)messages:send
POST/v1/inbound/chats/:id/take-overTake over a chat from the agent: you answer the visitor from here (or Slack)inbound:write
GET/v1/inbound/communityCommunity channels connected to this organization (GitHub App installations, Discord servers, Slack channels)inbound:read
DELETE/v1/inbound/community/:idDisconnect a community channel (owners)integrations:write
PATCH/v1/inbound/community/:idChoose the repositories or channels the agent answers in, its hourly cap, or pause it (owners)integrations:write
POST/v1/inbound/community/completeFinish connecting GitHub or Discord with what the provider sent back (owners)integrations:write
POST/v1/inbound/community/slackAnswer community questions in your Slack workspace (the organization's Slack connection; choose the channels next) (owners)integrations:write
POST/v1/inbound/community/startStart connecting GitHub or Discord (owners): returns the page to install or add the app on; it comes back to the Inbound pageintegrations:write
GET/v1/inbound/knowledge-gapsQuestions the website agent couldn't answer from public knowledge, most asked first (last 30 days)inbound:read
GET/v1/inbound/liveVisitors on your websites right now (who consented to tracking or are chatting): page, company, chatinbound:read
GET/v1/inbound/sitesWebsites with the chat widget: origins, settings and the snippet to pastesettings:read
POST/v1/inbound/sitesAdd a website (owners): the widget runs only on its allowed originssettings:write
PATCH/v1/inbound/sites/:idChange a website's origins, settings or turn its widget off (owners)settings:write
POST/v1/inbound/sites/:id/guide-secretCreate or replace the in-product guide's signing secret (owners); shown once. Your server signs users' tokens (HS256) with itsettings:write
DELETE/v1/inbound/sites/:id/logoRemove the chat launcher's logo (owners): it goes back to the assistant's initial or a chat bubblesettings:write
PUT/v1/inbound/sites/:id/logoUpload the chat launcher's logo (owners): PNG, JPEG or WebP, at most 256 KB and 16 to 1024 pixels a side; it's rebuilt without metadata and served from our origin. Without one the launcher shows the assistant's initial or a chat bubblesettings:write
POST/v1/inbound/sites/:id/rotate-keyReplace the site's public key (the old snippet stops working) (owners)settings:write
DELETE/v1/inbound/visitors/:idDelete a website visitor and everything recorded about them: chats, messages, events (a data-subject request) (owners)settings:write
GET/v1/me/inbound-alertsYour quiet hours and snooze for website visitor alerts (your time zone), and whether they're held right now—
PUT/v1/me/inbound-alertsSet your quiet hours (HH:MM to HH:MM your time, overnight allowed; null for none) or snooze website visitor alerts for some minutes (0 ends a snooze). While held they wait in your in-app list; a visitor asking for a person still reaches you (web app only)—

Examples

GET /v1/inbound/avatar

The video avatar's setup: whether the organization's Anam key is saved and Anam's browser SDK is installed (and its version)

curl -s "https://api.closefinch.com/v1/inbound/avatar" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/avatar`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/inbound/chats

Website chats, newest first (status: waiting for a person, with a person, the agent's, closed)

curl -s "https://api.closefinch.com/v1/inbound/chats" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/chats`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/inbound/chats/$ID

A website chat: messages with citations, the visitor, flags and qualification

curl -s "https://api.closefinch.com/v1/inbound/chats/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/chats/${id}`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/chats/$ID/close

Close a chat

curl -s -X POST "https://api.closefinch.com/v1/inbound/chats/$ID/close" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/chats/${id}/close`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/chats/$ID/hand-back

Give the chat back to the agent (it answers the visitor again)

curl -s -X POST "https://api.closefinch.com/v1/inbound/chats/$ID/hand-back" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/chats/${id}/hand-back`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/chats/$ID/reply

Reply to the visitor as yourself (takes the chat over from the agent)

curl -s -X POST "https://api.closefinch.com/v1/inbound/chats/$ID/reply" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/chats/${id}/reply`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/chats/$ID/take-over

Take over a chat from the agent: you answer the visitor from here (or Slack)

curl -s -X POST "https://api.closefinch.com/v1/inbound/chats/$ID/take-over" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/chats/${id}/take-over`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/inbound/community

Community channels connected to this organization (GitHub App installations, Discord servers, Slack channels)

curl -s "https://api.closefinch.com/v1/inbound/community" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/community`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

DELETE /v1/inbound/community/$ID

Disconnect a community channel (owners)

curl -s -X DELETE "https://api.closefinch.com/v1/inbound/community/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/community/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

PATCH /v1/inbound/community/$ID

Choose the repositories or channels the agent answers in, its hourly cap, or pause it (owners)

curl -s -X PATCH "https://api.closefinch.com/v1/inbound/community/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/community/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/community/complete

Finish connecting GitHub or Discord with what the provider sent back (owners)

curl -s -X POST "https://api.closefinch.com/v1/inbound/community/complete" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/community/complete`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/community/slack

Answer community questions in your Slack workspace (the organization's Slack connection; choose the channels next) (owners)

curl -s -X POST "https://api.closefinch.com/v1/inbound/community/slack" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/community/slack`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/community/start

Start connecting GitHub or Discord (owners): returns the page to install or add the app on; it comes back to the Inbound page

curl -s -X POST "https://api.closefinch.com/v1/inbound/community/start" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/community/start`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

GET /v1/inbound/knowledge-gaps

Questions the website agent couldn't answer from public knowledge, most asked first (last 30 days)

curl -s "https://api.closefinch.com/v1/inbound/knowledge-gaps" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/knowledge-gaps`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/inbound/live

Visitors on your websites right now (who consented to tracking or are chatting): page, company, chat

curl -s "https://api.closefinch.com/v1/inbound/live" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/live`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/inbound/sites

Websites with the chat widget: origins, settings and the snippet to paste

curl -s "https://api.closefinch.com/v1/inbound/sites" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

POST /v1/inbound/sites

Add a website (owners): the widget runs only on its allowed origins

curl -s -X POST "https://api.closefinch.com/v1/inbound/sites" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

PATCH /v1/inbound/sites/$ID

Change a website's origins, settings or turn its widget off (owners)

curl -s -X PATCH "https://api.closefinch.com/v1/inbound/sites/$ID" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites/${id}`, {
  method: "PATCH",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/sites/$ID/guide-secret

Create or replace the in-product guide's signing secret (owners); shown once. Your server signs users' tokens (HS256) with it

curl -s -X POST "https://api.closefinch.com/v1/inbound/sites/$ID/guide-secret" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites/${id}/guide-secret`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

Remove the chat launcher's logo (owners): it goes back to the assistant's initial or a chat bubble

curl -s -X DELETE "https://api.closefinch.com/v1/inbound/sites/$ID/logo" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites/${id}/logo`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

Upload the chat launcher's logo (owners): PNG, JPEG or WebP, at most 256 KB and 16 to 1024 pixels a side; it's rebuilt without metadata and served from our origin. Without one the launcher shows the assistant's initial or a chat bubble

curl -s -X PUT "https://api.closefinch.com/v1/inbound/sites/$ID/logo" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites/${id}/logo`, {
  method: "PUT",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

POST /v1/inbound/sites/$ID/rotate-key

Replace the site's public key (the old snippet stops working) (owners)

curl -s -X POST "https://api.closefinch.com/v1/inbound/sites/$ID/rotate-key" \
  -H "Authorization: Bearer $RA_API_KEY" \
  -H "content-type: application/json" \
  -d '{}'
const res = await fetch(`https://api.closefinch.com/v1/inbound/sites/${id}/rotate-key`, {
  method: "POST",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}`, "content-type": "application/json" },
  body: JSON.stringify({}), // fields: see the OpenAPI schema
});
const data = await res.json();

DELETE /v1/inbound/visitors/$ID

Delete a website visitor and everything recorded about them: chats, messages, events (a data-subject request) (owners)

curl -s -X DELETE "https://api.closefinch.com/v1/inbound/visitors/$ID" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/inbound/visitors/${id}`, {
  method: "DELETE",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

GET /v1/me/inbound-alerts

Your quiet hours and snooze for website visitor alerts (your time zone), and whether they're held right now

curl -s "https://api.closefinch.com/v1/me/inbound-alerts" \
  -H "Authorization: Bearer $RA_API_KEY"
const res = await fetch(`https://api.closefinch.com/v1/me/inbound-alerts`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.RA_API_KEY}` },
});
const data = await res.json();

Request and response schemas: https://www.closefinch.com/openapi.json. All resources: API reference.

Send feedback

Tell us what's broken, confusing or missing on this page, or an idea. It goes to the team that builds the product.

Please don't include passwords or card numbers.
Only to reply about this. Never added to any mailing list.