# Pin thread Pin a thread to keep it at the top of the thread list for easy access. Pin a thread so it appears at the top of the thread list. Pinned threads are useful for marking important or ongoing conversations. #### Path Parameters **`thread_id`** string required The unique identifier of the thread to pin. ## Returns Returns a pin status object with the thread ID and pin state. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/threads/thrd_abc123/pin" \ -H "X-API-Key: $FREDDY_API_KEY" ``` ```python Python SDK from aitronos import Aitronos client = Aitronos(api_key="your-api-key") client.threads.pin_thread("thrd_abc123") print("Thread pinned 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}/pin", 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}/pin`, { 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": true, "pinned_at": "2026-01-15T10:30:00Z", "message": "Thread pinned 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 - [Unpin Thread](/docs/api-reference/threads/unpin) - [List Threads](/docs/api-reference/threads/list) - [Retrieve Thread](/docs/api-reference/threads/retrieve)