Skip to main content
POST
Start Bot Chat

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
bot_id
string<uuid>

A bot from GET /bots.

Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
bot_ids
string<uuid>[]

Several bots, for a group chat. The first leads: it answers a message that names no bot. Pass this, bot_id, or both.

Maximum array length: 20
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
member_ids
string<uuid>[]

People in the workspace to bring into the chat, by user id. Every bot in the chat has to be shared with the workspace, or owned by the one person it is not shared with.

Maximum array length: 50
Pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
message
string
default:""

The first message. Without one, a new chat opens with the bot saying hi.

Maximum string length: 8000
title
string

Opens a new chat with this name. Without a title, one bot and no members, the request opens the caller's one direct chat with the bot, which is reused when it already exists.

Required string length: 1 - 80
attachments
object[]
Maximum array length: 10
idempotency_key
string

A key of your choosing that names this request. Repeating the request with the same key, for example after a timeout, sends nothing again: it answers with the same chat, message and cursor as the first. A start without a message sends nothing either way, and its cursor always follows your newest message.

Required string length: 1 - 200

Response

The chat, and where to read from.

chat_id
string
required
title
string
required
message_id
integer | null
required

The message just sent. Null when a chat was opened without one.

Required range: -9007199254740991 <= x <= 9007199254740991
cursor
string
required

Pass to GET /bots/chats/{chat_id}/messages.

bots
object[]
required
url
string
required