# Add thread to space Associate an existing thread with a space, automatically backfilling its messages into the space's shared memory. Add a thread to a space. When a thread is added, all existing messages in the thread are automatically enqueued for embedding into the space's dedicated vector store. Future messages in this thread will also be embedded automatically. Requires edit access to the space. #### Path Parameters **`space_id`** string required The unique identifier of the space. **`thread_id`** string required The unique identifier of the thread to add. ## Returns A success object with the space ID, thread ID, and timestamp. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/spaces/space_abc123/threads/thrd_def456" \ -H "X-API-Key: $FREDDY_API_KEY" ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.post( "https://api.aitronos.com/v1/spaces/space_abc123/threads/thrd_def456", headers={"X-API-Key": api_key}, ) print(response.json()) ``` ```javascript JavaScript const response = await fetch( "https://api.aitronos.com/v1/spaces/space_abc123/threads/thrd_def456", { method: "POST", headers: { "X-API-Key": apiKey }, } ); const data = await response.json(); ``` Response ```json 201 Created { "success": true, "message": "Thread added to space", "space_id": "space_abc123", "thread_id": "thrd_def456", "added_at": "2026-02-26T10:30:00Z" } ``` ```json 404 Not Found { "success": false, "error": { "code": "RESOURCE_NOT_FOUND", "message": "The requested resource could not be found.", "system_message": "Space not found", "type": "client_error", "status": 404, "details": { "space_id": "space_invalid" }, "trace_id": "abc-123-def", "timestamp": "2026-02-26T10:30:00Z" } } ``` ```json 403 Forbidden { "success": false, "error": { "code": "INSUFFICIENT_PERMISSIONS", "message": "You don't have permission to perform this action.", "system_message": "Edit access required", "type": "client_error", "status": 403, "details": { "space_id": "space_abc123" }, "trace_id": "abc-123-def", "timestamp": "2026-02-26T10:30:00Z" } } ``` ## Related Resources - [Remove Thread from Space](/docs/api-reference/spaces/remove-thread) - [List Space Threads](/docs/api-reference/spaces/list-threads) - [Create Space](/docs/api-reference/spaces/create) - [Retrieve Space](/docs/api-reference/spaces/retrieve)