Update Thread
/api/threads/{threadId}Updates thread properties including tags and agent assignment.
threadIdstringrequiredThe unique thread identifier (UUID)
tagsarrayArray of string tags (replaces existing tags)
agent_idstringNew agent to assign to the thread. The agent must have a human-backed side.
envobject | nullReplaces thread environment values.
Values must be strings.
null clears the environment.
env_typesobjectDisplay types for a replacement env.
A matching key with text permits display.
Other values use secret.
env_patchobjectAdds or replaces individual environment values. Keys must be non-empty after trimming. Values must be non-null. Values are converted to strings.
env_type_patchobjectChanges display types for existing environment keys.
Use text or secret.
A key without a matching environment value returns 400.
env_deletestring[]Removes the named environment keys and their display types.
Use either replacement fields or patch fields in one request.
Patch fields operate on the stored environment.
The response includes env_types but omits environment values.
Errors
The route returns 400 for invalid JSON, invalid field types, invalid environment patches, or an empty update.
An agent_id that is not a string returns 400.
An unknown agent returns 404.
An agent without a human-backed side returns 400.
Response
Returns the updated thread object.
idstringrequiredThread identifier
agent_idstringrequiredThe agent name associated with this thread
user_idstring | nullUser identifier if set
tagsarrayrequiredArray of string tags
created_atnumberrequiredUnix timestamp in seconds