Skip to main content

Chat API

The Chat API is available under /apis/v1/chat and requires a Ration bearer token. Every response is scoped to the authenticated user's tenant and room membership.

Authorization: Bearer <ration_access_token>
Accept: application/json

Response models

Room

FieldTypeDescription
idStringRoom identifier.
nameStringRoom or meeting name.
chat_typeStringpersonal, group, team, or meeting.
room_typeString or nullmeeting for a meeting room, when set.
partiesArrayRoom participants, including party_id and role data.
last_messageMessage or nullMost recent message, when available.
unseen, unreadNumber, BooleanCurrent caller's unread state.
inserted_at, updated_at, last_message_atStringTimestamps, when available.
meeting_mode, broadcast_mode, livestream_typeString or nullMeeting configuration, when applicable.
scheduled_start_at, scheduled_end_atString or nullScheduled meeting times, when applicable.

Message

FieldTypeDescription
idStringMessage identifier.
room_idStringParent room identifier.
bodyStringText body.
sending_party, nameStringSender identifier and display name.
message_typeStringMessage type; REST-created messages are text.
inserted_atStringCreation timestamp.
attachmentsArrayAttached-file metadata.
reply_toObject or nullReferenced message summary, when this is a reply.
edited, deletedBooleanMessage state.
reactionsArrayGrouped reaction data.

Identity and rooms

Get the current chat identity

GET /apis/v1/chat/user

Returns the caller's chat-facing identity.

Response fieldTypeDescription
id, name, username, addressStringUser identifiers and display details.
image, location, mobile, alternate, dob, genderString or nullProfile details, when set.
languageStringPreferred language, when set.

List tenant users

GET /apis/v1/chat/users

User-directory query parameters are passed to the tenant directory lookup.

Response fieldTypeDescription
usersArrayUser objects in the same shape as GET /chat/user.
totalNumberNumber of matching users.
pageNumberCurrent page, when returned.
nextCursor, previousCursorString or nullDirectory pagination cursors.

List rooms

GET /apis/v1/chat/rooms

NameInTypeRequiredDescription
chat_typeQueryStringNoLimit rooms to a type, such as personal, group, or meeting.
limitQueryIntegerNoPage size.
next_pointerQueryStringNoPointer from the prior response.

Response: { "results": [Room], "has_more": Boolean, "next_pointer": String | null }.

Create a room

POST /apis/v1/chat/rooms

{
"name": "Design review",
"chat_type": "group",
"party_ids": ["user_123", "user_456"]
}
NameTypeRequiredDescription
nameStringNo*Room name. Required for chat_type: "meeting".
chat_typeStringNoDefaults to personal; use group, team, or meeting as appropriate.
party_idsString arrayNoAdditional participant IDs. The caller is included automatically.
room_typeStringNoSet to meeting for a meeting room; inferred for chat_type: "meeting".
meeting_modeStringNoMeeting mode; defaults to instant for meetings.
broadcast_modeStringNobroadcast (default) or livestream.
livestream_typeStringNopublic (default) or private for livestream meetings.
scheduled_start_at, scheduled_end_atStringNoScheduled meeting start and end values.
meeting_reminder, reminderString or IntegerNoOptional meeting reminder.

Response: a Room object. A request for a meeting without a name returns 422 { "error": "meeting_name_required" }; livestream creation without the required plan capability returns 403 { "error": "livestream_not_entitled" }.

Read, update, or remove a room

GET|PUT|DELETE /apis/v1/chat/rooms/:id

GET returns a Room. PUT accepts room fields such as name, party_ids, and the meeting fields listed for creation, then returns the updated room. Send { "hide_options": true } to hide the room for the caller; it returns the text Successful.

DELETE removes the room from the caller's active view and returns the text Successful when the caller belongs to it.

Messages

List messages

GET /apis/v1/chat/rooms/:id/messages

NameInTypeRequiredDescription
idPathStringYesRoom identifier.
per_pageQueryIntegerNoPage size; defaults to 25, maximum 200.
next_pointerQueryStringNoMessage ID returned by the preceding page.

Response: { "results": [Message], "has_more": Boolean, "next_pointer": String | null }.

Send a message

POST /apis/v1/chat/rooms/:id/messages

{
"body": "Please review the latest draft.",
"reply_to_message_id": "message_123",
"client_token": "optional-client-correlation-id"
}
NameTypeRequiredDescription
bodyStringYesNon-empty text message body.
reply_to_message_idStringNoMessage to reply to.
client_tokenStringNoClient correlation value; echoed in a successful response.

Response: a Message object. An empty body returns 422 { "error": "empty_body" }.

Delete a message

DELETE /apis/v1/chat/rooms/:id/messages/:message_id

Response: the updated/deleted Message object.

Membership and attachments

Add or remove group/meeting members

POST /apis/v1/chat/rooms/:id/members

{ "member_ids": ["user_123", "user_456"] }

party_ids is accepted as an alias for member_ids. The room must be a group or meeting; the caller must already belong to the room. Response: the updated Room.

DELETE /apis/v1/chat/rooms/:id/members/:member_id removes one member and returns the updated room. A caller cannot remove themself with this endpoint.

Upload a chat attachment

POST /apis/v1/chat/attachments

Send multipart/form-data with one required file part. The maximum upload size is 25,000,000 bytes.

Response fieldTypeDescription
attachment.urlStringAuthenticated file URL.
attachment.secure_idStringStored-file identifier.
attachment.filenameStringOriginal filename.
attachment.content_typeStringMIME type.
attachment.sizeNumberFile size in bytes.
attachment.typeStringimage for image MIME types; otherwise file.

Errors

StatusErrorMeaning
401Authentication errorMissing, expired, or invalid bearer token.
403not_authorizedCaller is not a member of the room or cannot perform the operation.
404room_not_found, message_not_found, member_not_foundThe requested resource does not exist in the caller's tenant context.
422empty_body, invalid_message_id, missing_member_ids, unsupported_room, cannot_remove_self, update_failedRequest could not be applied.
500message_fetch_failed, message_send_failed, message_delete_failedServer-side chat operation failed.
Calls, meetings, and guest access

Meeting recordings, call-token minting, and external guest invite flows use related /apis/v1/meetings, /apis/v1/call, and invite-token routes. They are documented separately from ordinary room messaging because their authorization and lifecycle differ.