# List spaces List all spaces the current user has access to within an organization. Retrieve a paginated list of spaces that the authenticated user has access to. Results are filtered based on the space's `access_mode` and the user's roles, departments, and permissions: - **`organization`** โ€” visible to all members of the organization - **`public`** โ€” visible to everyone - **`private`** / **`custom`** โ€” visible only if the user is in `access_users`, has a role in `visible_to_roles`, belongs to a department in `access_departments`, or is the space creator Users with the `override_all_permissions` capability can see all spaces in the organization. #### Query Parameters **`organization_id`** string required Organization ID to list spaces for. **`limit`** integer optional ยท Defaults to `50` Maximum number of spaces to return. Must be between 1 and 100. **`cursor`** string optional Pagination cursor from a previous response's `next_cursor` field. ## Returns An object containing a `spaces` array of Space objects and a `next_cursor` for pagination. Request ```bash cURL curl "https://api.aitronos.com/v1/spaces/?organization_id=org_abc123&limit=20" \ -H "X-API-Key: $FREDDY_API_KEY" ``` ```python Python import os import requests api_key = os.environ["FREDDY_API_KEY"] response = requests.get( "https://api.aitronos.com/v1/spaces/", headers={"X-API-Key": api_key}, params={"organization_id": "org_abc123", "limit": 20}, ) print(response.json()) ``` ```javascript JavaScript const response = await fetch( "https://api.aitronos.com/v1/spaces/?organization_id=org_abc123&limit=20", { headers: { "X-API-Key": apiKey }, } ); const data = await response.json(); ``` Response ```json 200 OK { "spaces": [ { "id": "space_abc123", "organization_id": "org_abc123", "created_by": "usr_abc123", "name": "Product Knowledge Base", "description": "Shared memory for product team", "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": ["vs_catalog456"], "last_activity_at": "2026-02-26T15:30:00Z", "created_at": "2026-02-26T10:00:00Z", "updated_at": "2026-02-26T15:30:00Z" } ], "next_cursor": null } ``` ## Related Resources - [Create Space](/docs/api-reference/spaces/create) - [Retrieve Space](/docs/api-reference/spaces/retrieve) - [Update Space](/docs/api-reference/spaces/update) - [Delete Space](/docs/api-reference/spaces/delete)