# Create space Create a new space with an auto-linked dedicated vector store for shared memory across threads. Creates a new space within an organization. A dedicated vector store is automatically created and linked to the space for embedding thread messages as shared memory. Threads added to this space will have their messages embedded and retrievable across all threads in the space. #### Request Body **`organization_id`** string required The organization ID (e.g., `org_abc123...`). **`name`** string required Space name. Must be 1–255 characters. **`description`** string optional Optional description of the space. **`access_mode`** string optional · Defaults to `"private"` Access mode: `private`, `organization`, or `public`. **`access_users`** array of strings optional User IDs with view access. **`access_departments`** array of strings optional Department IDs with view access. **`editable_by_users`** array of strings optional User IDs with edit access. Use `"*"` for all users. **`editable_by_roles`** array of strings optional Role IDs with edit access. All IDs must refer to roles that exist in the organization. **`visible_to_roles`** array of strings optional Role IDs with view access. All IDs must refer to roles that exist in the organization. **`access_departments`** IDs are also validated — all department IDs must exist in the organization. A `422 Validation Error` is returned if any role or department ID is invalid. ## Returns A [Space object](/docs/api-reference/spaces/retrieve) with the auto-linked `vector_store_id` and empty `additional_vector_store_ids`. Request ```bash cURL curl -X POST "https://api.aitronos.com/v1/spaces/" \ -H "X-API-Key: $FREDDY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "organization_id": "org_abc123", "name": "Product Knowledge Base", "description": "Shared memory for product team conversations", "access_mode": "organization" }' ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.post( "https://api.aitronos.com/v1/spaces/", headers={"X-API-Key": api_key}, json={ "organization_id": "org_abc123", "name": "Product Knowledge Base", "description": "Shared memory for product team conversations", "access_mode": "organization", }, ) print(response.json()) ``` ```javascript JavaScript const response = await fetch("https://api.aitronos.com/v1/spaces/", { method: "POST", headers: { "X-API-Key": apiKey, "Content-Type": "application/json", }, body: JSON.stringify({ organization_id: "org_abc123", name: "Product Knowledge Base", description: "Shared memory for product team conversations", access_mode: "organization", }), }); const data = await response.json(); ``` Response ```json 201 Created { "id": "space_abc123", "organization_id": "org_abc123", "created_by": "usr_abc123", "name": "Product Knowledge Base", "description": "Shared memory for product team conversations", "vector_store_id": "vs_auto123", "access_mode": "organization", "access_users": null, "access_departments": null, "editable_by_users": null, "editable_by_roles": null, "visible_to_roles": null, "additional_vector_store_ids": [], "last_activity_at": null, "created_at": "2026-02-26T10:00:00Z", "updated_at": "2026-02-26T10:00:00Z" } ``` ```json 422 Validation Error { "success": false, "error": { "code": "VALIDATION_ERROR", "message": "The provided data is invalid.", "system_message": "Request validation failed", "type": "validation_error", "status": 422, "details": {}, "trace_id": "abc-123-def", "timestamp": "2026-02-26T10:00:00Z" } } ``` ## Related Resources - [Retrieve Space](/docs/api-reference/spaces/retrieve) - [List Spaces](/docs/api-reference/spaces/list) - [Update Space](/docs/api-reference/spaces/update) - [Delete Space](/docs/api-reference/spaces/delete) - [Add Thread to Space](/docs/api-reference/spaces/add-thread) - [Add Vector Store to Space](/docs/api-reference/spaces/add-vector-store)