# Unpin thread Unpin a previously pinned thread, removing it from the pinned position. Remove the pin from a thread. The thread will return to its default position in the thread list sorted by last activity. #### Path Parameters **`thread_id`** string required The unique identifier of the thread to unpin. ## Returns Returns a pin status object with the thread ID and updated pin state. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/threads/thrd_abc123/unpin" \ -H "X-API-Key: $FREDDY_API_KEY" ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") client.threads.unpin_thread("thrd_abc123") print("Thread unpinned successfully.") ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] thread_id = "thrd_abc123" response = requests.post( f"https://api.aitronos.com/v1/threads/{thread_id}/unpin", headers={"X-API-Key": api_key} ) result = response.json() print(f"Thread {result['id']} pinned: {result['is_pinned']}") ``` ```javascript JavaScript const apiKey = process.env.FREDDY_API_KEY; const threadId = "thrd_abc123"; const response = await fetch( `https://api.aitronos.com/v1/threads/${threadId}/unpin`, { method: "POST", headers: { "X-API-Key": apiKey, }, } ); const result = await response.json(); console.log(`Thread ${result.id} pinned: ${result.is_pinned}`); ``` Response ```json 200 OK { "id": "thrd_abc123", "is_pinned": false, "pinned_at": null, "message": "Thread unpinned successfully" } ``` ```json 401 Unauthorized { "success": false, "error": { "code": "AUTHENTICATION_REQUIRED", "message": "Authentication required. Please provide a valid API key.", "system_message": "Authentication required. Please provide a valid API key.", "type": "authentication_error", "status": 401, "details": {}, "trace_id": "req_abc123xyz", "timestamp": "2025-12-22T15:30:00Z" } } ``` ```json 404 Not Found { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "The requested resource could not be found.", "system_message": "Thread not found.", "type": "client_error", "status": 404, "details": { "thread_id": "thrd_abc123" }, "trace_id": "req_abc123xyz", "timestamp": "2025-12-22T15:30:00Z" } } ``` ## Related Resources - [Pin Thread](/docs/api-reference/threads/pin) - [List Threads](/docs/api-reference/threads/list) - [Retrieve Thread](/docs/api-reference/threads/retrieve)