v1

latestOpenAPI 3.0.02026-07-174565114.3 KB
v1

Update thread

Update thread metadata such as name. Useful for manual thread renaming.

patch/v1/threads/{threadId}

Path parameters

threadIdstring required
Example:thr_abc123xyz

Thread ID

Query parameters

userKeystring

Optional user key for thread organization

Request body

namestring

Thread name (for manual renaming)

metadataobject

Additional metadata to update

Response

Updated thread

idstring required

Unique identifier for this thread

namestring

Thread name (auto-generated or user-set)

userKeystring

Optional user key for thread organization

runStatus'idle' | 'waiting' | 'streaming' required

Current run status: idle (no run), waiting (run started, awaiting content), streaming (receiving content)

currentRunIdstring

ID of the currently active run (when not idle)

statusMessagestring

Human-readable status message (e.g., 'Fetching weather data...')

lastRunCancelledboolean

Whether the last run was cancelled

pendingToolCallIdsstring[]

Tool call IDs awaiting client-side results. If non-empty, next run must provide tool_result content with previousRunId set.

lastCompletedRunIdstring

ID of the last completed run. Required as previousRunId when continuing after tool calls.

metadataobject

Additional metadata

createdAtstring required

When the thread was created (ISO 8601)

updatedAtstring required

When the thread was last updated (ISO 8601)

Example response

{
  "id": "thr_abc123xyz",
  "runStatus": "idle",
  "lastRunError": {
    "code": "INTERNAL_ERROR",
    "message": "An unexpected error occurred"
  },
  "createdAt": "2024-01-15T12:00:00Z",
  "updatedAt": "2024-01-15T12:05:00Z"
}