v1

latestOpenAPI 3.0.02026-07-174565114.3 KB
v1

Update component state

Update the state of a component in a thread. Supports both full replacement and JSON Patch operations. Thread must not have an active run.

post/v1/threads/{threadId}/components/{componentId}/state

Path parameters

threadIdstring required
Example:thr_abc123xyz

Thread ID

componentIdstring required
Example:comp_xyz789abc

Component ID

Request body

userKeystring

Identifier for a user in your system. Required if no bearer token is provided.

stateobject

Full replacement state object

Example request

{
  "state": {
    "loading": false,
    "data": [
      1,
      2,
      3
    ]
  },
  "patch": [
    {
      "op": "replace",
      "path": "/loading",
      "value": false
    },
    {
      "op": "add",
      "path": "/data/-",
      "value": 4
    }
  ]
}

Response

Component state updated successfully

stateobject required

New complete state of the component

Example response

{
  "state": {
    "loading": false,
    "data": [
      1,
      2,
      3,
      4
    ]
  }
}