Xe Chat API

Base URL: https://api.xeboki.com/v1/chat

The Xe Chat API gives you programmatic access to customer conversations, messaging, contact management, and agent assignment. Build support automations, sync contact data, trigger outbound messages, and query conversation history — all via REST.

Support automations

Create conversations and send messages programmatically when events happen in your system.

CRM sync

Push customer data into Xe Chat contacts from your own CRM so agents always have full context.

Conversation routing

Assign conversations to agents or teams based on your own routing logic via the update endpoint.

Reporting & exports

Pull conversation history and message logs for compliance, auditing, or analytics.

Inboxes: All conversations belong to an inbox. An inbox represents a channel (email, live chat, WhatsApp, etc.). Retrieve your inbox IDs via GET /v1/chat/inboxes before creating conversations.

Authentication

All requests require a valid API key in the Authorization header. Create and manage keys at account.xeboki.com .

Authorization: Bearer xbk_live_your_key_here

Required scopes

chat:conversations:readList and retrieve conversations
chat:conversations:writeCreate and update conversations
chat:messages:readRead messages within conversations
chat:messages:writeSend messages
chat:contacts:readList and retrieve contacts
chat:contacts:writeCreate and update contacts
chat:agents:readList agents
chat:agents:writeCreate and manage agents
chat:inboxes:readList inboxes and channel IDs

Conversations

A conversation is a thread of messages between a contact and one or more agents, in a specific inbox.

GET/v1/chat/conversations

List conversations

Returns conversations for your account. Filter by status, inbox, or assigned agent.

Query parameters

ParameterTypeDescription
statusstring"open" | "resolved" | "pending" | "snoozed" (default: all).
inbox_idintegerFilter by inbox.
agent_idintegerFilter by assigned agent.
pageintegerPage number (default: 1).
limitintegerResults per page, max 50 (default: 25).
curl "https://api.xeboki.com/v1/chat/conversations?status=open&page=1" \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "data": [
    {
      "id": 1024,
      "status": "open",
      "inbox_id": 3,
      "contact": { "id": 55, "name": "Alice Smith", "email": "alice@example.com" },
      "assigned_agent": { "id": 7, "name": "Bob Jones" },
      "unread_count": 2,
      "last_activity_at": "2026-03-31T11:45:00Z",
      "created_at": "2026-03-31T10:00:00Z"
    }
  ],
  "total": 84,
  "page": 1,
  "limit": 25
}
POST/v1/chat/conversations

Create a conversation

Create a new conversation on behalf of a contact. Useful for proactive outreach or importing threads from another system.

Request body

ParameterTypeDescription
inbox_idrequiredintegerThe inbox to create the conversation in.
contact_idrequiredintegerThe contact this conversation belongs to.
agent_idintegerAssign to a specific agent immediately.
statusstring"open" | "pending" (default: "open").
messageobjectOptional opening message to send.
message.contentstringText content of the opening message.
curl -X POST https://api.xeboki.com/v1/chat/conversations \
  -H "Authorization: Bearer xbk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "inbox_id": 3,
    "contact_id": 55,
    "message": {
      "content": "Hi Alice, following up on your recent order."
    }
  }'

Response 201

{
  "id": 1025,
  "status": "open",
  "inbox_id": 3,
  "contact": { "id": 55, "name": "Alice Smith", "email": "alice@example.com" },
  "assigned_agent": null,
  "unread_count": 0,
  "created_at": "2026-03-31T12:00:00Z"
}
GET/v1/chat/conversations/{id}

Get a conversation

Retrieve a single conversation by its ID.

curl https://api.xeboki.com/v1/chat/conversations/1024 \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "id": 1024,
  "status": "open",
  "inbox_id": 3,
  "contact": { "id": 55, "name": "Alice Smith", "email": "alice@example.com" },
  "assigned_agent": { "id": 7, "name": "Bob Jones" },
  "unread_count": 2,
  "last_activity_at": "2026-03-31T11:45:00Z",
  "created_at": "2026-03-31T10:00:00Z"
}
PATCH/v1/chat/conversations/{id}

Update a conversation

Change the status or reassign to a different agent. Only provided fields are changed.

Request body

ParameterTypeDescription
statusstring"open" | "resolved" | "pending" | "snoozed".
agent_idintegerReassign to a different agent. Pass null to unassign.
curl -X PATCH https://api.xeboki.com/v1/chat/conversations/1024 \
  -H "Authorization: Bearer xbk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "status": "resolved" }'

Response 200

{
  "id": 1024,
  "status": "resolved",
  "inbox_id": 3,
  "assigned_agent": { "id": 7, "name": "Bob Jones" },
  "updated_at": "2026-03-31T12:30:00Z"
}

Messages

Messages are the individual exchanges within a conversation.

GET/v1/chat/conversations/{id}/messages

List messages

Returns all messages in a conversation, oldest first.

Query parameters

ParameterTypeDescription
pageintegerPage number (default: 1).
limitintegerResults per page, max 100 (default: 50).
curl "https://api.xeboki.com/v1/chat/conversations/1024/messages" \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "data": [
    {
      "id": 2001,
      "conversation_id": 1024,
      "type": "incoming",
      "content": "Hi, I have a question about my order.",
      "sender": { "type": "contact", "id": 55, "name": "Alice Smith" },
      "created_at": "2026-03-31T10:05:00Z"
    },
    {
      "id": 2002,
      "conversation_id": 1024,
      "type": "outgoing",
      "content": "Hi Alice! I'd be happy to help. What is your order number?",
      "sender": { "type": "agent", "id": 7, "name": "Bob Jones" },
      "created_at": "2026-03-31T10:08:00Z"
    }
  ],
  "total": 2
}
POST/v1/chat/conversations/{id}/messages

Send a message

Send an outgoing message in a conversation. Delivered to the contact via the inbox channel.

Request body

ParameterTypeDescription
contentrequiredstringText content of the message.
privatebooleanSet true to send a private note (visible to agents only, not the contact).
agent_idintegerSend as a specific agent. Defaults to the key owner.
curl -X POST https://api.xeboki.com/v1/chat/conversations/1024/messages \
  -H "Authorization: Bearer xbk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "content": "Your order #1234 has shipped! Tracking: XY9876543." }'

Response 201

{
  "id": 2003,
  "conversation_id": 1024,
  "type": "outgoing",
  "content": "Your order #1234 has shipped! Tracking: XY9876543.",
  "private": false,
  "sender": { "type": "agent", "id": 7, "name": "Bob Jones" },
  "created_at": "2026-03-31T12:10:00Z"
}

Contacts

Contacts represent the customers or end-users who initiate or participate in conversations.

GET/v1/chat/contacts

List contacts

Query parameters

ParameterTypeDescription
qstringSearch by name, email, or phone.
pageintegerPage number (default: 1).
limitintegerResults per page, max 100 (default: 25).
curl "https://api.xeboki.com/v1/chat/contacts?q=alice" \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "data": [
    {
      "id": 55,
      "name": "Alice Smith",
      "email": "alice@example.com",
      "phone": "+1 555 000 1234",
      "conversation_count": 3,
      "created_at": "2026-01-15T09:00:00Z"
    }
  ],
  "total": 1
}
POST/v1/chat/contacts

Create a contact

Request body

ParameterTypeDescription
namerequiredstringFull name of the contact.
emailstringEmail address. Must be unique.
phonestringPhone number in E.164 format.
curl -X POST https://api.xeboki.com/v1/chat/contacts \
  -H "Authorization: Bearer xbk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Alice Smith", "email": "alice@example.com" }'

Response 201

{
  "id": 56,
  "name": "Alice Smith",
  "email": "alice@example.com",
  "phone": null,
  "conversation_count": 0,
  "created_at": "2026-03-31T12:00:00Z"
}
GET/v1/chat/contacts/{id}

Get a contact

curl https://api.xeboki.com/v1/chat/contacts/55 \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "id": 55,
  "name": "Alice Smith",
  "email": "alice@example.com",
  "phone": "+1 555 000 1234",
  "conversation_count": 3,
  "created_at": "2026-01-15T09:00:00Z"
}

Agents

Agents are the support team members who handle conversations.

GET/v1/chat/agents

List agents

curl https://api.xeboki.com/v1/chat/agents \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "data": [
    {
      "id": 7,
      "name": "Bob Jones",
      "email": "bob@yourcompany.com",
      "role": "agent",
      "availability": "online"
    }
  ],
  "total": 5
}
POST/v1/chat/agents

Create an agent

Request body

ParameterTypeDescription
namerequiredstringFull name of the agent.
emailrequiredstringEmail address. Used to sign in to the Xe Chat console.
rolestring"agent" | "administrator" (default: "agent").
curl -X POST https://api.xeboki.com/v1/chat/agents \
  -H "Authorization: Bearer xbk_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Carol White", "email": "carol@yourcompany.com", "role": "agent" }'

Response 201

{
  "id": 8,
  "name": "Carol White",
  "email": "carol@yourcompany.com",
  "role": "agent",
  "availability": "offline"
}

Inboxes

Inboxes represent the channels your team uses to communicate (live chat widget, email, WhatsApp, etc.). Inboxes are created in the Xe Chat console — use this endpoint to list them and retrieve their IDs for use in conversation creation.

GET/v1/chat/inboxes

List inboxes

curl https://api.xeboki.com/v1/chat/inboxes \
  -H "Authorization: Bearer xbk_live_your_key_here"

Response 200

{
  "data": [
    {
      "id": 3,
      "name": "Website Live Chat",
      "channel_type": "live_chat",
      "is_enabled": true
    },
    {
      "id": 4,
      "name": "Support Email",
      "channel_type": "email",
      "is_enabled": true
    }
  ]
}

Error codes

CodeErrorCause
400Bad RequestMissing required field or invalid value.
401UnauthorizedMissing or expired API key.
403ForbiddenAPI key lacks the required scope.
404Not FoundConversation, contact, or agent ID not found.
409ConflictContact with this email already exists.
422Validation Errorinbox_id or contact_id does not exist in your account.
429Too Many RequestsRate limit exceeded. Check your plan limits.
500Internal Server ErrorContact support with your request ID.