Skip to main content
POST
/
threads
/
{thread_id}
/
state
Update Thread State
curl --request POST \
  --url https://api.example.com/threads/{thread_id}/state \
  --header 'Content-Type: application/json' \
  --data '
{
  "values": {},
  "checkpoint": {},
  "checkpoint_id": "<string>",
  "as_node": "<string>",
  "subgraphs": false,
  "checkpoint_ns": "<string>"
}
'
{
  "values": {},
  "checkpoint": {
    "checkpoint_id": "<string>",
    "thread_id": "<string>",
    "checkpoint_ns": ""
  },
  "next": [
    "<string>"
  ],
  "tasks": [
    {}
  ],
  "interrupts": [
    {}
  ],
  "metadata": {},
  "created_at": "2023-11-07T05:31:56Z",
  "parent_checkpoint": {
    "checkpoint_id": "<string>",
    "thread_id": "<string>",
    "checkpoint_ns": ""
  },
  "checkpoint_id": "<string>",
  "parent_checkpoint_id": "<string>"
}

Path Parameters

thread_id
string
required

Body

application/json

Request model for updating thread state

values
Values · object

The values to update the state with

checkpoint
Checkpoint · object

The checkpoint to update the state of

checkpoint_id
string | null

Optional checkpoint ID to update from

as_node
string | null

Update the state as if this node had just executed

subgraphs
boolean | null
default:false

Include states from subgraphs

checkpoint_ns
string | null

Checkpoint namespace

Response

Successful Response

Thread state model for history endpoint

values
Values · object
required

Channel values (messages, etc.)

checkpoint
ThreadCheckpoint · object
required

Current checkpoint

next
string[]

Next nodes to execute

tasks
Tasks · object[]

Tasks to execute

interrupts
Interrupts · object[]

Interrupt data

metadata
Metadata · object

Checkpoint metadata

created_at
string<date-time> | null

Timestamp of state creation

parent_checkpoint
ThreadCheckpoint · object

Parent checkpoint

checkpoint_id
string | null

Checkpoint ID (for backward compatibility)

parent_checkpoint_id
string | null

Parent checkpoint ID (for backward compatibility)