POST
/
v1
/
chat
/
states
/
{type}
/
{id}
/
{name}
/
get-or-set
curl --request POST \
  --url https://api.botpress.cloud/v1/chat/states/{type}/{id}/{name}/get-or-set \
  --header 'Content-Type: application/json' \
  --data '{
  "payload": {},
  "expiry": 1296000000.5
}'
{
  "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": {}
  },
  "meta": {
    "cached": true
  }
}

Path Parameters

type
enum<string>
required

State type

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

State id

name
string
required

State name

Body

application/json
State content

The body is of type object.

Response

200
application/json
Returns the [State](#schema_state) object if a valid identifiers were provided. Returns [an error](#errors) otherwise.

The response is of type object.