> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anonalabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Spaces

# Spaces API

Create and manage Memory Spaces - the isolation boundary for memories within your organization.

## Create a Space

```http theme={null}
POST /v1/spaces/
Authorization: Bearer anona_live_YOUR_KEY
Content-Type: application/json
```

**Request Body:**

```json theme={null}
{
  "name": "customer-support-bot",
  "description": "Memories for the customer support chatbot"
}
```

| Parameter     | Type   | Required | Description            |
| ------------- | ------ | -------- | ---------------------- |
| `name`        | string | Yes      | Display name           |
| `description` | string | No       | What this space is for |

**Response (200 OK):**

```json theme={null}
{
  "space_id": "spc_a1b2c3d4",
  "name": "customer-support-bot",
  "description": "Memories for the customer support chatbot",
  "created_at": "2026-07-14T12:34:56Z"
}
```

`space_id` is server-generated - you don't choose it. Save it; every memory operation requires it.

***

## List Spaces

```http theme={null}
GET /v1/spaces/
Authorization: Bearer anona_live_YOUR_KEY
```

**Response (200 OK):**

```json theme={null}
{
  "spaces": [
    {
      "space_id": "spc_a1b2c3d4",
      "name": "customer-support-bot",
      "created_at": "2026-07-14T12:34:56Z"
    }
  ],
  "total": 1
}
```

***

## Get Space Details

```http theme={null}
GET /v1/spaces/{space_id}
Authorization: Bearer anona_live_YOUR_KEY
```

**Response (200 OK):**

```json theme={null}
{
  "space_id": "spc_a1b2c3d4",
  "name": "customer-support-bot",
  "description": "Memories for the customer support chatbot",
  "created_at": "2026-07-14T12:34:56Z"
}
```

***

## Delete a Space

```http theme={null}
DELETE /v1/spaces/{space_id}
Authorization: Bearer anona_live_YOUR_KEY
```

**Response:** `204 No Content` - the space and all its memories are permanently deleted.

⚠️ This cannot be undone.

***

## Space Members (Organization Sharing)

Spaces can optionally have named members within your organization:

```http theme={null}
GET /v1/spaces/{space_id}/members
POST /v1/spaces/{space_id}/members
DELETE /v1/spaces/{space_id}/members/{member_id}
```

A space with no member rows at all is treated as org-wide - reachable by anyone in the organization. Adding a member row switches the space into enforced, member-only access.

***

## Error Responses

| Status | Code           | Cause                        |
| ------ | -------------- | ---------------------------- |
| 400    | `bad_request`  | Missing `name`               |
| 401    | `unauthorized` | Missing/invalid API key      |
| 403    | `forbidden`    | Space not owned by your org  |
| 404    | `not_found`    | Space doesn't exist          |
| 429    | `rate_limited` | Quota or rate limit exceeded |

See the full [error reference](/api-reference/errors).

***

## Python SDK

The SDK currently exposes read access to spaces:

```python theme={null}
spaces = client.list_spaces()
for s in spaces:
    print(s["space_id"], s["name"])
```

Space creation/deletion is currently API-only (or via the dashboard) - not yet wrapped by the Python client.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Memories API" icon="square-plus" href="/api-reference/memories">
    Store and manage memories
  </Card>

  <Card title="Error Reference" icon="circle-exclamation" href="/api-reference/errors">
    Complete error code reference
  </Card>
</CardGroup>
