Skip to main content
PATCH
/
v1
/
chat
/
states
/
{type}
/
{id}
/
{name}
cURL
curl --request PATCH \
  --url https://api.botpress.cloud/v1/chat/states/{type}/{id}/{name} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'x-bot-id: <x-bot-id>' \
  --data '{
  "payload": {}
}'
{
  "state": {
    "id": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "botId": "<string>",
    "conversationId": "<string>",
    "userId": "<string>",
    "name": "<string>",
    "type": "conversation",
    "payload": {}
  }
}

Authorizations

Authorization
string
header
required

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

Headers

x-bot-id
string
required

Bot id

x-integration-id
string

Integration id

x-integration-alias
string

Integration alias

Path Parameters

type
enum<string>
required

Represents the resource type that the state is related to

Available options:
conversation,
user,
bot,
integration,
task,
workflow
id
string
required

Id of the State which will be either the botId, the userId or the conversationId

name
string
required

Name of the State which is declared inside the bot definition

Body

application/json

State content

payload
object
required

Payload is the content of the state defined by your bot.

Response

Returns the updated State object if a valid identifier was provided. Returns an an error otherwise

state
object
required

The state object represents the current payload. A state is always linked to either a bot, a conversation or a user.