Skip to content

chats.sendBotMessage

POST
/v1/bots/{botId}/messages
curl --request POST \
--url https://example.com/v1/bots/example/messages \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "commandKey": "example", "input": [ { "type": "message", "role": "user", "content": [ { "type": "input_text", "text": "example" } ] } ], "queue": true }'

Sends a message to your Chat with this Bot. OpenBot makes the Chat the first time. When the Bot is free, the message starts a Turn at once. When the Bot works for you, it reads the message at its next step. You need bots.delegate on the Bot.

botId
required
string
>= 1 characters <= 128 characters
Media typeapplication/json
object
commandKey
required
string
>= 1 characters <= 128 characters
input
required
Any of:
string
>= 1 characters
queue
boolean

Success

Media typeapplication/json
object
executionId
required
string
>= 1 characters <= 128 characters
commandKey
required
string
>= 1 characters <= 128 characters
sequence
required
integer
<= 9007199254740991
chat
required
string
turn
required
string

Example generated

{
"executionId": "example",
"commandKey": "example",
"sequence": 1,
"chat": "example",
"turn": "example"
}

ChatModelInvalid | FileInvalid | BotInvalid | OrganizationRequired

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ChatModelInvalid
reason
required
string
Allowed values: provider-not-found model-not-found unsupported-option missing
message
required
string

Example

{
"_tag": "ChatModelInvalid",
"reason": "provider-not-found"
}

AuthenticationRequired

Media typeapplication/json
object
_tag
required
string
Allowed values: AuthenticationRequired

Example

{
"_tag": "AuthenticationRequired"
}

ExecutionForbidden | @nmnmcc/ability/Authorizer/Forbidden | MembershipRequired | ForbiddenOrigin

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ExecutionForbidden

Example

{
"_tag": "ExecutionForbidden"
}

ExecutionNotFound | ChatNotFound | BotNotFound

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ExecutionNotFound
id
required
string
>= 1 characters <= 128 characters

Example

{
"_tag": "ExecutionNotFound"
}

ExecutionConflict | ExecutionKeyConflict | ChatConflict | @nmnmcc/ability/Authorizer/Pending | BotConflict

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ExecutionConflict
id
required
string
>= 1 characters <= 128 characters

Example

{
"_tag": "ExecutionConflict"
}

RateLimited

Media typeapplication/json
object
_tag
required
string
Allowed values: RateLimited
retryAfterSeconds
required
integer
>= -9007199254740991 <= 9007199254740991

Example

{
"_tag": "RateLimited"
}

ExecutionUnavailable | ChatStorageUnavailable | ChatExecutionUnavailable | BotStorageUnavailable | AuthenticationUnavailable | RequestFailed

Media typeapplication/json
Any of:
object
_tag
required
string
Allowed values: ExecutionUnavailable
errorId
required
string
>= 1 characters <= 128 characters

Example

{
"_tag": "ExecutionUnavailable"
}