Every REST endpoint of the in-app chat API, plus the WebSocket operations, events, webhooks, limits and error codes the SDKs are built on.
Base URL https://api-videosdk.titliapp.com. The REST endpoints on this page (/v1/chat/*) are your server API: they use your project API key as HTTP Basic auth (key_id:key_secret), exactly like the video API; the scope is that key's project. An app does not need them: with your App Key (Quick mode) the SDK talks to the WebSocket and to the two app routes in the Client API. New here? Start with the chat quickstart.
Set in your dashboard vs. set in code
Setting
Where
App Key, its bindings (package name, bundle ID, website, signing certificate) and Quick-mode caps
Dashboard: Console → Projects → Quick mode
Chat push credentials (FCM, APNs), profanity filter and word list, recall window, webhook events
Dashboard: Console → Chat
Chat plan (Free, Pay as you go)
Dashboard: Console → Chat
Chat token lifetime
Code: Quick mode handles it for you; with server tokens, ttl_seconds (60 to 604800 seconds)
Live-room slow mode and freeze
Code: your server (PATCH /v1/chat/rooms/{room_id})
Who the user is (user id, display name)
Code: init / setUser in the app
Which routes are server-only, and why
Everything an app user does in chat (open a conversation, send, read, react, recall their own message, join a room, push registration, call invites) runs over the WebSocket with a chat token, and in Quick mode the SDK gets that token with your App Key (POST /v1/chat/client/tokens) and saves the user's own profile (PUT /v1/chat/client/users/{user_id}). The routes below are for your server, and some of them can only ever be called from a server:
Bans (POST /v1/chat/users/{user_id}/ban) and user erase (DELETE /v1/chat/users/{user_id}): they act on another person, so they must never be reachable with a key that ships inside an app.
Server-side conversations and messages (create, list, send, add or remove members, moderation recall): they act as any user you name and skip the checks an app user gets (block lists, admin roles, the recall window).
Room settings and host messages (PATCH /v1/chat/rooms/{room_id}, POST /v1/chat/rooms/{room_id}/messages): they control a whole room and skip slow mode and rate limits.
Usage (GET /v1/chat/usage): it shows your plan, MAU and charges, which are account data.
The App Key is publishable, so it can only reach the app routes. Keep the API key secret on your server for everything here.
Errors are {"error":{"code","message"}} with the HTTP status listed under Errors; 429 answers add retry_after_ms and a Retry-After header. JSON bodies need Content-Type: application/json. The server API allows 20 requests per second per API key (burst 40). In each table below, "required (in the path)" means the value is part of the URL; every other parameter of a GET goes in the query string and of a POST, PUT or PATCH in the JSON body.
Tokens and users
POST/v1/chat/tokens
Mints a chat token for one of your users (production hardening; Quick mode apps use the Client API instead). Answers 201 and creates or updates the profile.
Parameter
Type
Required
Default
Allowed values
What it means
Example
user_id
string
required
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Your own id for the person the token is for. The call also creates or updates the profile.
u_42
name
string
optional
unchanged (none for a new user)
up to 80 characters
Display name shown to other users.
Asha
avatar_url
string
optional
unchanged (none for a new user)
up to 500 characters
Link to the profile picture.
https://cdn.example.com/a.jpg
custom
object
optional
unchanged ({} for a new user)
a JSON object
Your own data on the profile (for example a role or a level). Replaces the stored object when sent.
{"level":3}
ttl_seconds
integer
optional
3600
60 to 604800 (7 days)
How long the token works. When it expires the SDK asks for a new one and reconnects.
3600
Field
Type
What it means
token
string
The chat token. The app passes it to connect().
user_id
string
The user it is for.
expires_at
string
ISO time it stops working.
ws_url
string
The WebSocket address.
api_url
string
The API address (for uploads).
PUT/v1/chat/users/{user_id}
Creates or updates a user profile. Fields you leave out stay as they are.
Parameter
Type
Required
Default
Allowed values
What it means
Example
user_id
string
required (in the path)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Your own id for the person.
u_42
name
string
optional
unchanged (none for a new user)
up to 80 characters
Display name shown to other users.
Asha
avatar_url
string
optional
unchanged (none for a new user)
up to 500 characters
Link to the profile picture.
https://cdn.example.com/a.jpg
custom
object
optional
unchanged ({} for a new user)
a JSON object
Your own data on the profile (for example a role or a level). Replaces the stored object when sent.
{"level":3}
Field
Type
What it means
id
string
The user id.
name
string or null
Display name.
avatar_url
string or null
Profile picture link.
custom
object
Your own data ({} when none).
GET/v1/chat/users/{user_id}
One user, with ban and last-seen details. 404 not_found when the user never connected or was made.
Parameter
Type
Required
Default
Allowed values
What it means
Example
user_id
string
required (in the path)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Your own id for the person.
u_42
Field
Type
What it means
id
string
The user id.
name
string or null
Display name.
avatar_url
string or null
Profile picture link.
custom
object
Your own data ({} when none).
banned_until
string or null
ISO time a ban ends; null when not banned.
last_seen_at
string or null
ISO time the user was last connected.
created_at
string
ISO time the profile was made.
POST/v1/chat/users/{user_id}/ban
Server-only. Bans a user until a time, or lifts the ban. A banned user is refused at the next connection (close code 4003, reason banned); a connection that is already open stays until it reconnects, at the latest when its token expires.
Parameter
Type
Required
Default
Allowed values
What it means
Example
user_id
string
required (in the path)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Your own id for the person.
u_42
until
string or null
optional
null (lifts the ban)
an ISO date and time, or null
Ban the user until this time. Leave it out or send null to lift a ban.
2026-12-31T00:00:00Z
Field
Type
What it means
user_id
string
The user.
banned_until
string or null
The ban end; null when lifted.
DELETE/v1/chat/users/{user_id}
Server-only. Erases a user (privacy request): profile, devices, blocks and group memberships; the user's messages are recalled.
Parameter
Type
Required
Default
Allowed values
What it means
Example
user_id
string
required (in the path)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Your own id for the person.
u_42
Field
Type
What it means
deleted
boolean
Always true.
Conversations and messages
Server-only. These act on behalf of one of your users, named in each request.
POST/v1/chat/conversations
Makes a direct chat or a group. Answers 201 and the conversation as the acting user sees it.
Parameter
Type
Required
Default
Allowed values
What it means
Example
type
string
optional
group
direct or group (anything else makes a group)
What to make. A direct chat between the same two people is made once and returned again after that.
direct
created_by
string
required
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
The user acting: the creator, who becomes the group owner. You may send as_user instead.
u_42
as_user
string
optional (instead of created_by)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Another name for created_by.
u_42
user_id
string
required for direct
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -; not the creator
The other person in a direct chat.
u_99
name
string
optional
–
up to 100 characters
Group name.
Weekend plans
members
array of strings
optional
the creator only
user ids; the group size limit of your plan
Group members. The creator is added for you.
["u_99","u_7"]
avatar_url
string
optional
–
up to 500 characters
Group picture link.
https://cdn.example.com/g.jpg
custom
object
optional
{}
a JSON object up to 2 KB
Your own data on the group.
{"topic":"trip"}
Field
Type
What it means
id
string
Conversation id: d_… direct, g_… group.
type
string
direct or group.
name
string or null
Group name; for a direct chat, the other person's name or id.
avatar_url
string or null
Group picture, or the other person's.
custom
object
Your own data on the group.
member_count
integer
Number of members.
members
array of strings
Member ids (groups up to 100 members; both people in a direct chat).
last_seq
integer
The seq of the newest message.
last_message
object or null
The newest message (same fields as a message).
last_message_at
string or null
ISO time of the newest message.
read_seq
integer
The acting user's read position.
unread_count
integer
last_seq − read_seq for the acting user.
muted
boolean
Whether the acting user muted it.
role
string
The acting user's role: owner, admin or member.
peer
object
Direct chats only: { id, name, avatar_url, custom } of the other person.
peer_read_seq
integer
Direct chats only: how far the other person has read.
peer_delivered_seq
integer
Direct chats only: how far messages reached the other person.
slow_mode_s
integer
Slow mode in seconds (0 = off).
frozen
boolean
Whether the conversation is frozen.
created_at
string
ISO time it was made.
updated_at
string
ISO time of the last change.
GET/v1/chat/conversations
One user's inbox with unread counts, newest first.
Parameter
Type
Required
Default
Allowed values
What it means
Example
user_id
string
required (query)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Whose inbox to list.
u_42
limit
integer
optional (query)
30
1 to 100
Conversations per page.
50
before
string
optional (query)
–
the next value of the previous page
Cursor for the next (older) page.
MjAyNi0xMS0yOVQxMDowMDowMC4wMDBafGdfNWYw
Field
Type
What it means
items
array
Conversations (fields as below), newest activity first. Rooms are not listed.
next
string or null
Cursor for the next page; null on the last page.
items[].id
string
Conversation id: d_… direct, g_… group.
items[].type
string
direct or group.
items[].name
string or null
Group name; for a direct chat, the other person's name or id.
items[].avatar_url
string or null
Group picture, or the other person's.
items[].custom
object
Your own data on the group.
items[].member_count
integer
Number of members.
items[].members
array of strings
Member ids (groups up to 100 members; both people in a direct chat).
items[].last_seq
integer
The seq of the newest message.
items[].last_message
object or null
The newest message (same fields as a message).
items[].last_message_at
string or null
ISO time of the newest message.
items[].read_seq
integer
The acting user's read position.
items[].unread_count
integer
last_seq − read_seq for the acting user.
items[].muted
boolean
Whether the acting user muted it.
items[].role
string
The acting user's role: owner, admin or member.
items[].peer
object
Direct chats only: { id, name, avatar_url, custom } of the other person.
items[].peer_read_seq
integer
Direct chats only: how far the other person has read.
items[].peer_delivered_seq
integer
Direct chats only: how far messages reached the other person.
items[].slow_mode_s
integer
Slow mode in seconds (0 = off).
items[].frozen
boolean
Whether the conversation is frozen.
items[].created_at
string
ISO time it was made.
items[].updated_at
string
ISO time of the last change.
GET/v1/chat/conversations/{cid}/messages
A page of history, as one member sees it.
Parameter
Type
Required
Default
Allowed values
What it means
Example
cid
string
required (in the path)
–
up to 120 characters; d_… (direct) or g_… (group)
The conversation id, as returned when the conversation was made.
g_5f0c2a9e41b7d3c8a6e1f204
user_id
string
required (query)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -; a member
The member reading the history (their cleared and hidden messages are left out).
u_42
before_seq
integer
optional (query)
–
a positive seq
Older page: messages before this seq.
120
after_seq
integer
optional (query)
–
0 or more; wins over before_seq
Catch up: messages after this seq, oldest first.
98
limit
integer
optional (query)
30
1 to 100
Messages per page.
50
Field
Type
What it means
items
array
Messages in ascending seq (fields as below).
has_more
boolean
True when there are more in that direction.
items[].id
string
Message id (UUID).
items[].cid
string
Conversation id (r_<room_id> for a room).
items[].seq
integer
Gap-free position in the conversation, from 1. Sort by this.
items[].client_id
string or null
Your idempotency key, if sent.
items[].sender
string
Sender user id.
items[].sender_name
string
Sender display name, when known.
items[].type
string
Message type.
items[].text
string or null
Text after the profanity filter; null once recalled.
items[].mentions
array of strings
Mentioned user ids.
items[].reply_to
integer or null
The seq it replies to.
items[].attachment
object or null
The file, with a signed url valid for 7 days (store the key).
items[].custom
object or null
Your own data.
items[].reactions
object
Emoji to the user ids who reacted.
items[].edited_at
string or null
ISO time of the last edit.
items[].recalled
boolean
True once recalled (text, custom and reactions are cleared).
items[].created_at
string
ISO time it was sent.
items[].updated_at
string
ISO time of the last change.
POST/v1/chat/conversations/{cid}/messages
Sends as a member (for example a bot, or a migration) or a system message. Answers 201 and the message. Fan-out and push work as for app sends; server sends skip block checks and the freeze, and system messages are not pushed.
Parameter
Type
Required
Default
Allowed values
What it means
Example
cid
string
required (in the path)
–
up to 120 characters; d_… (direct) or g_… (group)
The conversation id, as returned when the conversation was made.
g_5f0c2a9e41b7d3c8a6e1f204
sender
string
required
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -; a member
The member the message is sent as (for example a bot member). You may send as_user instead.
bot_1
as_user
string
optional (instead of sender)
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Another name for sender.
bot_1
type
string
optional
text
text, image, file, voice, custom, system
The kind of message. system is server only and needs custom (or text, wrapped as { text }).
text
text
string
required for text
–
up to 4,000 characters
The message text. The project profanity filter masks or blocks it.
Welcome!
custom
object
required for custom
–
a JSON object up to 8 KB
Your own data: a gift, a card, a poll, an order.
{"kind":"gift","id":"rose"}
attachment
object
required for image, file, voice
–
{ key } from an upload, or { url } (https, up to 1,000 characters); optional name, mime, size, width, height, duration_ms, waveform (up to 64 values 0–100)
The file of a media message. Images need an image type and voice messages an audio type.
{"key":"p_1/ab12.jpg","width":800,"height":600}
mentions
array of strings
optional
the @user names found in the text
up to 50 user ids
Users mentioned in the message.
["u_99"]
reply_to
integer
optional
–
a positive seq
The seq of the message this one replies to.
41
client_id
string
optional
–
up to 64 characters
Your idempotency key: the same value in the same conversation within 24 hours returns the stored message with duplicate: true.
c-7f3a
Field
Type
What it means
id
string
Message id (UUID).
cid
string
Conversation id (r_<room_id> for a room).
seq
integer
Gap-free position in the conversation, from 1. Sort by this.
client_id
string or null
Your idempotency key, if sent.
sender
string
Sender user id.
sender_name
string
Sender display name, when known.
type
string
Message type.
text
string or null
Text after the profanity filter; null once recalled.
mentions
array of strings
Mentioned user ids.
reply_to
integer or null
The seq it replies to.
attachment
object or null
The file, with a signed url valid for 7 days (store the key).
custom
object or null
Your own data.
reactions
object
Emoji to the user ids who reacted.
edited_at
string or null
ISO time of the last edit.
recalled
boolean
True once recalled (text, custom and reactions are cleared).
created_at
string
ISO time it was sent.
updated_at
string
ISO time of the last change.
duplicate
boolean
Only on a repeated client_id: the stored message is returned.
POST/v1/chat/conversations/{cid}/members
Adds people to a group. Answers the updated conversation.
Parameter
Type
Required
Default
Allowed values
What it means
Example
cid
string
required (in the path)
–
up to 120 characters; d_… (direct) or g_… (group)
The conversation id, as returned when the conversation was made.
g_5f0c2a9e41b7d3c8a6e1f204
as_user
string
required
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -; a member
The member acting. From your server any member may add people.
u_42
user_ids
array of strings
required
–
1 to 100 user ids; the group size limit of your plan
People to add. New members do not see older history.
["u_7","u_8"]
Field
Type
What it means
id
string
Conversation id: d_… direct, g_… group.
type
string
direct or group.
name
string or null
Group name; for a direct chat, the other person's name or id.
avatar_url
string or null
Group picture, or the other person's.
custom
object
Your own data on the group.
member_count
integer
Number of members.
members
array of strings
Member ids (groups up to 100 members; both people in a direct chat).
last_seq
integer
The seq of the newest message.
last_message
object or null
The newest message (same fields as a message).
last_message_at
string or null
ISO time of the newest message.
read_seq
integer
The acting user's read position.
unread_count
integer
last_seq − read_seq for the acting user.
muted
boolean
Whether the acting user muted it.
role
string
The acting user's role: owner, admin or member.
peer
object
Direct chats only: { id, name, avatar_url, custom } of the other person.
peer_read_seq
integer
Direct chats only: how far the other person has read.
peer_delivered_seq
integer
Direct chats only: how far messages reached the other person.
slow_mode_s
integer
Slow mode in seconds (0 = off).
frozen
boolean
Whether the conversation is frozen.
created_at
string
ISO time it was made.
updated_at
string
ISO time of the last change.
POST/v1/chat/conversations/{cid}/members/remove
Removes people from a group. Answers the updated conversation.
Parameter
Type
Required
Default
Allowed values
What it means
Example
cid
string
required (in the path)
–
up to 120 characters; d_… (direct) or g_… (group)
The conversation id, as returned when the conversation was made.
g_5f0c2a9e41b7d3c8a6e1f204
as_user
string
required
–
1 to 128 characters: A-Z a-z 0-9 _ . : @ -; a member
The member acting. If the owner removes themself, the oldest member becomes owner.
u_42
user_ids
array of strings
required
–
at least 1 user id
People to remove.
["u_8"]
Field
Type
What it means
id
string
Conversation id: d_… direct, g_… group.
type
string
direct or group.
name
string or null
Group name; for a direct chat, the other person's name or id.
avatar_url
string or null
Group picture, or the other person's.
custom
object
Your own data on the group.
member_count
integer
Number of members.
members
array of strings
Member ids (groups up to 100 members; both people in a direct chat).
last_seq
integer
The seq of the newest message.
last_message
object or null
The newest message (same fields as a message).
last_message_at
string or null
ISO time of the newest message.
read_seq
integer
The acting user's read position.
unread_count
integer
last_seq − read_seq for the acting user.
muted
boolean
Whether the acting user muted it.
role
string
The acting user's role: owner, admin or member.
peer
object
Direct chats only: { id, name, avatar_url, custom } of the other person.
peer_read_seq
integer
Direct chats only: how far the other person has read.
peer_delivered_seq
integer
Direct chats only: how far messages reached the other person.
Moderation recall of a message of any age. Answers the recalled message.
Parameter
Type
Required
Default
Allowed values
What it means
Example
cid
string
required (in the path)
–
up to 120 characters; d_… (direct) or g_… (group)
The conversation id, as returned when the conversation was made.
g_5f0c2a9e41b7d3c8a6e1f204
seq
integer
required (in the path)
–
a positive integer
The message to recall. Any age: the recall window applies to app users only.
42
as_user
string
optional
the oldest member
1 to 128 characters: A-Z a-z 0-9 _ . : @ -; a member
The member shown as the one who recalled it (use an admin or bot member).
mod_1
Field
Type
What it means
id
string
Message id (UUID).
cid
string
Conversation id (r_<room_id> for a room).
seq
integer
Gap-free position in the conversation, from 1. Sort by this.
client_id
string or null
Your idempotency key, if sent.
sender
string
Sender user id.
sender_name
string
Sender display name, when known.
type
string
Message type.
text
string or null
Text after the profanity filter; null once recalled.
mentions
array of strings
Mentioned user ids.
reply_to
integer or null
The seq it replies to.
attachment
object or null
The file, with a signed url valid for 7 days (store the key).
custom
object or null
Your own data.
reactions
object
Emoji to the user ids who reacted.
edited_at
string or null
ISO time of the last edit.
recalled
boolean
True once recalled (text, custom and reactions are cleared).
created_at
string
ISO time it was sent.
updated_at
string
ISO time of the last change.
Live rooms
Server-only. Rooms need no creation: the first join or server call makes the room.
PATCH/v1/chat/rooms/{room_id}
Sets slow mode or freezes the room. Everyone in the room receives a notice event with code: "room_settings".
Parameter
Type
Required
Default
Allowed values
What it means
Example
room_id
string
required (in the path)
–
1 to 96 characters: A-Z a-z 0-9 _ . : -
Your own id for the live room. Rooms need no creation: the first join or server call makes it.
live_123
slow_mode_s
integer
optional
unchanged (0 for a new room)
0 to 3600
One message per user every this many seconds. 0 turns slow mode off.
10
frozen
boolean
optional
unchanged (false for a new room)
true or false
A frozen room takes no messages from app users.
false
Field
Type
What it means
room_id
string
The room.
slow_mode_s
integer
Slow mode now in force.
frozen
boolean
Whether the room is frozen now.
POST/v1/chat/rooms/{room_id}/messages
A host or system message; it skips slow mode, freeze and the per-user room rate. Answers 201 and the message (room messages are kept only as the last 50 for late joiners).
Parameter
Type
Required
Default
Allowed values
What it means
Example
room_id
string
required (in the path)
–
1 to 96 characters: A-Z a-z 0-9 _ . : -
Your own id for the live room. Rooms need no creation: the first join or server call makes it.
live_123
sender
string
optional
system
1 to 128 characters: A-Z a-z 0-9 _ . : @ -
Who the message is from (a host id, or system).
host_1
sender_name
string
optional
–
any text
The name shown with it.
Host
type
string
optional
text
text, image, file, voice, custom, system
The kind of message. system is server only.
text
text
string
required for text
–
up to 4,000 characters
The message text. The project profanity filter masks or blocks it.
Welcome!
custom
object
required for custom
–
a JSON object up to 8 KB
Your own data: a gift, a card, a poll, an order.
{"kind":"gift","id":"rose"}
attachment
object
required for image, file, voice
–
{ key } from an upload, or { url } (https, up to 1,000 characters); optional name, mime, size, width, height, duration_ms, waveform (up to 64 values 0–100)
The file of a media message. Images need an image type and voice messages an audio type.
{"key":"p_1/ab12.jpg","width":800,"height":600}
mentions
array of strings
optional
the @user names found in the text
up to 50 user ids
Users mentioned in the message.
["u_99"]
reply_to
integer
optional
–
a positive seq
The seq of the message this one replies to.
41
client_id
string
optional
–
up to 64 characters
Your idempotency key: the same value in the same room within 10 minutes is refused as a duplicate.
c-7f3a
Field
Type
What it means
id
string
Message id (UUID).
cid
string
Conversation id (r_<room_id> for a room).
seq
integer
Gap-free position in the conversation, from 1. Sort by this.
client_id
string or null
Your idempotency key, if sent.
sender
string
Sender user id.
sender_name
string
Sender display name, when known.
type
string
Message type.
text
string or null
Text after the profanity filter; null once recalled.
mentions
array of strings
Mentioned user ids.
reply_to
integer or null
The seq it replies to.
attachment
object or null
The file, with a signed url valid for 7 days (store the key).
custom
object or null
Your own data.
reactions
object
Emoji to the user ids who reacted.
edited_at
string or null
ISO time of the last edit.
recalled
boolean
True once recalled (text, custom and reactions are cleared).
Which chat features are on (for example media, rooms, webhooks).
currency
string
INR or USD.
mau
integer
Monthly active users so far.
billable_mau
integer
MAU above the free ones.
estimated_charge
number
The month's charge so far, in the currency.
charged_so_far
number
What has already been debited.
messages
integer
Messages this month.
room_messages
integer
Live-room messages this month.
peak_connections
integer
Highest concurrent connections.
storage_bytes
integer
Media stored now.
daily
array
Per day: day, messages, room_messages, media_bytes, peak_connections.
End-user upload
POST/chat/v1/upload?cid=<cid>&name=<file name>
Headers: Authorization: Bearer <chat token> and Content-Type: <mime>; raw body (not multipart). Both query parameters are optional. Returns 201 { key, url, mime, size, name }. The size limit comes from your plan: Free 10 MB, Pay as you go 25 MB, Scale 50 MB. Content is checked, so an executable renamed to .png is refused. url is a signed link valid for 7 days, and messages get fresh links every time they are returned, so store the key. The SDKs call this for you, in Quick mode too.
Allowed types: images (JPEG, PNG, WebP, GIF, HEIC), audio (AAC, M4A, MP4, MPEG, Ogg, WebM, WAV), video (MP4, WebM, QuickTime), PDF, zip, text and office documents.
WebSocket
Connect to wss://api-videosdk.titliapp.com/chat/ws?token=<token>. All frames are JSON text, up to 64 KB. The SDKs do this for you; this section is for reference.
The server sends hello after auth ({ protocol, session_id, user, server_time, heartbeat_ms, limits, features }); the client pings every heartbeat_ms (25 seconds) and a connection that sends nothing for twice that plus 5 seconds is dropped. Every request with a rid gets exactly one ack.
Close code
Reason
What the client does
4001
Token invalid or expired, or no auth within 10 seconds
Get a new token (tokenProvider) and reconnect
4003
chat_disabled, project_disabled, banned, cap_reached (Free plan MAU cap), payment_required (new user, empty balance)
Do not retry; show the reason
4008
The client is not reading (too slow)
Reconnect with backoff
4029
More than 10 connections for this user, or the plan's concurrent-connection cap
Reconnect with backoff
1001
Server restart
Reconnect at once
Operations
Operation
Request fields
Reply
conv.list
limit (≤ 100), before
{ items, next }
conv.direct
user_id
Conversation (created if missing)
conv.get
cid
Conversation
conv.create
name, members, avatar_url, custom (always a group; the caller becomes owner)
{ invitation_id, user_id } plus data (accepted) or reason (rejected)
notice
{ code: "room_settings", room_id, slow_mode_s, frozen } after your server changes a room
Ordering, receipts and unread
Every message has a per-conversation seq: gap-free, starting at 1, assigned by the server. Sort by seq, never by time.
Sends are idempotent by client_id, so a retried message is never duplicated.
Ticks: read if peer_read_seq ≥ seq, else delivered if peer_delivered_seq ≥ seq, else sent.
unread_count = last_seq − read_seq. Rooms have no unread count, and room messages are kept only for late joiners (the last 50).
Webhooks
Enable chat events per project in Console → Chat → Settings. They go to the project's webhook URL with the same signature and retry policy as call events (Titli-Signature: t=<ts>,v1=<hmac>).
All values are strings. body is the text preview (up to 100 characters), a media label, or "New message" when previews are off for the project. On FCM a message push also has a notification block and a call invite is data-only (your app shows the ringing). On APNs both are normal alert pushes; VoIP (PushKit) pushes are not sent, and the call push does not carry the invite data.