# Update thread div strong 🔨 In Development — This section is still being developed and may change. Modify thread properties including metadata, title, and visibility settings. OpenAI compatible with Freddy enhancements. Modify thread properties including metadata, title, and visibility settings. Uses partial updates - only provided fields are modified. OpenAI compatible with additional Freddy enhancements. #### Path Parameters **`thread_id`** string required The unique identifier of the thread to update. #### Request Body **`metadata`** object optional Custom key-value pairs for thread metadata. Performs partial update - merges with existing metadata. Maximum 16 key-value pairs. **`title`** string optional Display name for the thread. Maximum 200 characters. Full replacement of existing title. **`visibleInUi`** boolean optional Whether this thread should be visible in the user interface. Requires Bearer token authentication. Update Metadata ```bash curl -X POST "https://api.freddy.aitronos.com/v1/threads/thread_abc123" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "metadata": { "category": "support", "priority": "high", "status": "resolved" } }' ``` ```python import requests response = requests.post( "https://api.freddy.aitronos.com/v1/threads/thread_abc123", headers={"Authorization": f"Bearer {api_key}"}, json={ "metadata": { "category": "support", "priority": "high", "status": "resolved" } } ) thread = response.json() print(f"Updated thread metadata: {thread['metadata']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/threads/thread_abc123', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ metadata: { category: 'support', priority: 'high', status: 'resolved' } }) }); const thread = await response.json(); console.log(`Updated thread metadata:`, thread.metadata); ``` Update Title ```bash curl -X POST "https://api.freddy.aitronos.com/v1/threads/thread_abc123" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Resolved Billing Issue" }' ``` ```python import requests response = requests.post( "https://api.freddy.aitronos.com/v1/threads/thread_abc123", headers={"Authorization": f"Bearer {api_key}"}, json={"title": "Resolved Billing Issue"} ) thread = response.json() print(f"Updated title: {thread['title']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/threads/thread_abc123', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ title: 'Resolved Billing Issue' }) }); const thread = await response.json(); console.log(`Updated title: ${thread.title}`); ``` Hide from UI ```bash curl -X POST "https://api.freddy.aitronos.com/v1/threads/thread_abc123" \ -H "Authorization: Bearer $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "visibleInUi": false }' ``` ```python import requests response = requests.post( "https://api.freddy.aitronos.com/v1/threads/thread_abc123", headers={"Authorization": f"Bearer {api_key}"}, json={"visibleInUi": False} ) thread = response.json() print(f"Thread visibility: {thread['visibleInUi']}") ``` ```javascript const response = await fetch('https://api.freddy.aitronos.com/v1/threads/thread_abc123', { method: 'POST', headers: { 'Authorization': `Bearer ${apiKey}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ visibleInUi: false }) }); const thread = await response.json(); console.log(`Thread visibility: ${thread.visibleInUi}`); ``` ## Response 200 OK ```json { "id": "thread_abc123", "object": "thread", "createdAt": 1741476542, "updatedAt": 1741476700, "metadata": { "category": "support", "priority": "high", "status": "resolved" }, "assistantId": "asst_support_agent", "organizationId": "ORG_123", "userId": "uid_user123", "title": "Resolved Billing Issue", "visibleInUi": false, "messageCount": 5, "status": "inactive" } ``` Errors ```json 400 Bad Request { "error": { "message": "Invalid request parameters", "type": "invalid_request_error", "code": "invalid_parameters" } } ``` ```json 404 Not Found { "error": { "message": "Thread not found or access denied", "type": "not_found_error", "code": "thread_not_found" } } ``` ```json 422 Validation Error { "error": { "message": "Title cannot be empty", "type": "validation_error", "code": "invalid_title", "param": "title" } } ``` ## Related Resources - [Threads Overview](/docs/documentation/core-concepts/threads-overview) - [Retrieve Thread](/docs/api-reference/threads/retrieve) - [Update Thread Metadata](/docs/api-reference/threads/update-metadata) - [Thread Context Modes](/docs/documentation/core-concepts/thread-context-modes)