v1
latestOpenAPI 3.0.02026-07-174565114.3 KBv1
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
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
Example response
{
"state": {
"loading": false,
"data": [
1,
2,
3,
4
]
}
}