Skip to content

Update Thread

PATCH/api/threads/{threadId}

Updates thread properties including tags and agent assignment.

threadIdstringrequired

The unique thread identifier (UUID)

tagsarray

Array of string tags (replaces existing tags)

agent_idstring

New agent to assign to the thread. The agent must have a human-backed side.

envobject | null

Replaces thread environment values. Values must be strings. null clears the environment.

env_typesobject

Display types for a replacement env. A matching key with text permits display. Other values use secret.

env_patchobject

Adds or replaces individual environment values. Keys must be non-empty after trimming. Values must be non-null. Values are converted to strings.

env_type_patchobject

Changes 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.

idstringrequired

Thread identifier

agent_idstringrequired

The agent name associated with this thread

user_idstring | null

User identifier if set

tagsarrayrequired

Array of string tags

created_atnumberrequired

Unix timestamp in seconds