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

# Workspaces

> Workspace management, members, file reservations, and real-time feed

## Create Workspace

```bash theme={null}
POST /workspaces
Authorization: Bearer ek_...

{
  "name": "My Startup",
  "slug": "my-startup"
}
```

**Response**

```json theme={null}
{
  "id": "ws_abc123",
  "name": "My Startup",
  "slug": "my-startup",
  "created_at": "2026-04-13T00:00:00Z"
}
```

***

## List Workspaces

```bash theme={null}
GET /workspaces
Authorization: Bearer ek_...
```

Returns all workspaces the authenticated user is a member of.

***

## Get Workspace

```bash theme={null}
GET /workspaces/:id
Authorization: Bearer ek_...
```

***

## Update Workspace

```bash theme={null}
PATCH /workspaces/:id
Authorization: Bearer ek_...

{
  "name": "New Name"
}
```

***

## Members

### List Members

```bash theme={null}
GET /workspaces/:id/members
Authorization: Bearer ek_...
```

### Add Member

```bash theme={null}
POST /workspaces/:id/members
Authorization: Bearer ek_...

{
  "user_id": "usr_...",
  "role": "member"
}
```

Roles: `owner`, `admin`, `member`

### Remove Member

```bash theme={null}
DELETE /workspaces/:id/members/:userId
Authorization: Bearer ek_...
```

### Member Detail

Full drill-down for a specific member: sessions, decisions, traces, work packages, file reservations.

```bash theme={null}
GET /workspaces/:id/members/:userId/detail
Authorization: Bearer ek_...
```

***

## File Reservations

### List Reservations

```bash theme={null}
GET /workspaces/:id/reservations
Authorization: Bearer ek_...
```

**Response**

```json theme={null}
[
  {
    "file_path": "src/auth/login.ts",
    "user_id": "usr_abc",
    "user_name": "Developer A",
    "conversation_id": "conv_xyz",
    "current_task": "Build JWT auth flow",
    "expires_at": "2026-04-13T10:35:00Z"
  }
]
```

***

## Work Packages

### List Packages

```bash theme={null}
GET /workspaces/:id/packages
Authorization: Bearer ek_...
```

Query params:

* `status` — filter by `open`, `claimed`, `in_progress`, `completed`
* `assignee` — filter by user ID

### Claim Package

```bash theme={null}
POST /workspaces/:id/packages/:pid/claim
Authorization: Bearer ek_...
```

### Update Package Status

```bash theme={null}
PATCH /workspaces/:id/packages/:pid/status
Authorization: Bearer ek_...

{
  "status": "in_progress"
}
```

***

## Knowledge Graph

Returns nodes and edges for the force-directed graph visualization.

```bash theme={null}
GET /workspaces/:id/graph
Authorization: Bearer ek_...
```

**Response**

```json theme={null}
{
  "nodes": [
    { "id": "dec_abc", "type": "decision", "label": "Use JWT for auth" },
    { "id": "file_src/auth/login.ts", "type": "file", "label": "src/auth/login.ts" }
  ],
  "edges": [
    { "source": "dec_abc", "target": "file_src/auth/login.ts" }
  ]
}
```

***

## Real-time Feed (SSE)

Server-Sent Events stream of agent activity.

```bash theme={null}
GET /workspaces/:id/feed
Authorization: Bearer ek_...
```

Event types: `agent_sync`, `decision_recorded`, `file_reserved`, `conflict_detected`

```
data: {"type":"decision_recorded","decision":{"title":"Use JWT for auth"},"user":"Developer A"}

data: {"type":"file_reserved","file":"src/auth/login.ts","by":"Developer A"}
```
