# Add vector store to space Attach an additional external vector store to a space for expanded knowledge access during conversations. Attach an existing vector store to a space as an additional knowledge source. Threads in this space will automatically include the attached vector store's data during RAG-powered conversations. Requires edit access to the space. #### Path Parameters **`space_id`** string required The unique identifier of the space (e.g., `space_abc123...`). **`vector_store_id`** string required The unique identifier of the vector store to attach (e.g., `vs_abc123...`). Must belong to the same organization as the space. ## Returns A success object with the space ID, vector store ID, and timestamp of when the attachment was created. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/spaces/space_abc123/vector-stores/vs_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/vector-stores/vs_def456", headers={"X-API-Key": api_key}, ) print(response.json()) ``` ```javascript JavaScript const response = await fetch( "https://api.aitronos.com/v1/spaces/space_abc123/vector-stores/vs_def456", { method: "POST", headers: { "X-API-Key": apiKey }, } ); const data = await response.json(); ``` Response ```json 201 Created { "success": true, "message": "Vector store added to space", "space_id": "space_abc123", "vector_store_id": "vs_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 404 Vector Store Not Found { "success": false, "error": { "code": "VECTOR_STORE_NOT_FOUND", "message": "Vector store not found.", "system_message": "Vector store not found", "type": "client_error", "status": 404, "details": { "vector_store_id": "vs_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" } } ``` ```json 409 Conflict { "success": false, "error": { "code": "RESOURCE_ALREADY_EXISTS", "message": "This resource already exists.", "system_message": "Vector store already attached to space", "type": "client_error", "status": 409, "details": { "space_id": "space_abc123", "vector_store_id": "vs_def456" }, "trace_id": "abc-123-def", "timestamp": "2026-02-26T10:30:00Z" } } ``` ```json 422 Validation Error — Own Vector Store { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "The provided data is invalid.", "system_message": "Cannot add space's own dedicated vector store as additional", "type": "client_error", "status": 422, "details": { "space_id": "space_abc123", "vector_store_id": "vs_abc123" }, "trace_id": "abc-123-def", "timestamp": "2026-02-26T10:30:00Z" } } ``` ```json 422 Validation Error — Cross-Organization { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "The provided data is invalid.", "system_message": "Vector store belongs to a different organization", "type": "client_error", "status": 422, "details": { "space_id": "space_abc123", "vector_store_id": "vs_other_org" }, "trace_id": "abc-123-def", "timestamp": "2026-02-26T10:30:00Z" } } ``` ## Related Resources - [Remove Vector Store from Space](/docs/api-reference/spaces/remove-vector-store) - [List Space Vector Stores](/docs/api-reference/spaces/list-vector-stores) - [Retrieve Space](/docs/api-reference/spaces/retrieve) - [Create Space](/docs/api-reference/spaces/create) - [Add Thread to Space](/docs/api-reference/spaces/add-thread)