Conversations

Complete Conversation Message

Send and receive a conversation response

post
/v1/conversation/{conversationId}/complete

Authorization

ChatBotKit API Secret * Required

HTTP Authorization Scheme: bearer

Path Parameters

conversationIdstring* Required

The ID of the conversation to receive message from

X-Timezonestring

Request Body * Required

Request Body Schema: application/json

textstring

The text of the message to send

entitiesarray

Known entities

typestring

The entity type

beginnumber

Start offset

endnumber

End offset

textstring

The text value of the entity

replacementobject

beginnumber

Start offset

endnumber

End offset

textstring

The text value of the replacement

functionsarray

An array of functions to be added to the conversation

namestring

The name of the function (must be a valid JS identifier, max 64 chars)

descriptionstring

The description of the function

parametersobject

JSON Schema definition for the function parameters

typestring

The schema type, must be "object"

propertiesobject

Object property definitions

requiredarray

Required property names

resultunknown

The result of the function execution

callobject

Configuration for when this function should be automatically called

startboolean

If true, this function will be force-called at the start of the conversation

endboolean

If true, this function will be force-called at the end of the conversation

extensionsobject

Extensions to enhance the bot's capabilities

backstorystring

Additional backstory for the bot

datasetsarray

Inline datasets to provide additional context

namestring

The name of the dataset

descriptionstring

The description of the dataset

recordsarray

The records in the dataset

textstring

The text content of the record

metaobject

Additional metadata for the record

skillsetsarray

Inline skillsets to provide additional abilities

namestring

The name of the skillset

descriptionstring

The description of the skillset

abilitiesarray

The abilities in the skillset

namestring

The name of the ability

descriptionstring

The description of the ability

instructionstring

The instruction for the ability

secretIdstring

Optional secret ID for the ability

metaobject

Additional metadata for the ability

featuresarray

Feature flags to enable specific bot capabilities

namestring

The name of the feature to enable

optionsobject

Optional configuration options for the feature

limitsobject

Execution limits to control conversation processing bounds

iterationsinteger

Maximum number of agentic iterations. Controls how many times the model can iterate through tool calls and responses.

continuationsinteger

Maximum number of model continuations. Controls how many times the model can continue generating after reaching a stop condition.

callsinteger

Maximum number of function/tool calls. Controls how many total function calls can be made during the conversation.

import { ChatBotKit } from '@chatbotkit/sdk'

const cbk = new ChatBotKit({

secret: process.env.CHATBOTKIT_API_KEY!

})

const response = await cbk.conversation.complete(

conversationId,
{
"text":"string",
"entities":[
{
"type":"string",
"begin":"number",
"end":"number",
"text":"string",
"replacement":{
"begin":"number",
"end":"number",
"text":"string"
}
}
],
"functions":[
{
"name":"string",
"description":"string",
"parameters":{
"type":"string",
"properties":"object",
"required":[
"string"
]
},
"result":"",
"call":{
"start":"boolean",
"end":"boolean"
}
}
],
"extensions":{
"backstory":"string",
"datasets":[
{
"name":"string",
"description":"string",
"records":[
{
"text":"string",
"meta":"object"
}
]
}
],
"skillsets":[
{
"name":"string",
"description":"string",
"abilities":[
{
"name":"string",
"description":"string",
"instruction":"string",
"secretId":"string",
"meta":"object"
}
]
}
],
"features":[
{
"name":"string",
"options":"object"
}
]
},
"limits":{
"iterations":"integer",
"continuations":"integer",
"calls":"integer"
}
}
)
{
"id":"string",
"text":"string",
"usage":{
"token":"number"
},
"end":{
"reason":"string"
}
}
The next message in the conversation completed successfully