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

# Workspace

> Get and update workspace configuration, toggle the kill switch.

## Get Workspace

```
GET /v1/workspace/
```

Returns the current workspace configuration.

**Auth**: JWT or API Key

### Response `200`

```json theme={null}
{
  "id": "770e8400-e29b-41d4-a716-446655440000",
  "name": "My Workspace",
  "slug": "my-workspace",
  "kill_switch": false,
  "daily_budget_usd": 100.0,
  "user_daily_budget_usd": 25.0,
  "max_concurrent_runs": 10
}
```

| Field                   | Type             | Description                                    |
| ----------------------- | ---------------- | ---------------------------------------------- |
| `id`                    | `string`         | Workspace UUID                                 |
| `name`                  | `string`         | Workspace display name                         |
| `slug`                  | `string`         | URL-safe identifier                            |
| `kill_switch`           | `boolean`        | Whether the kill switch is active              |
| `daily_budget_usd`      | `number \| null` | Workspace daily spend limit (null = unlimited) |
| `user_daily_budget_usd` | `number \| null` | Per-user daily spend limit (null = unlimited)  |
| `max_concurrent_runs`   | `integer`        | Maximum simultaneous active runs               |

***

## Update Workspace

```
PATCH /v1/workspace/
```

Updates workspace configuration. Only include fields you want to change.

**Auth**: JWT or API Key

### Request Body

```json theme={null}
{
  "name": "Production Workspace",
  "daily_budget_usd": 200.0,
  "user_daily_budget_usd": 50.0,
  "max_concurrent_runs": 20
}
```

| Field                   | Type              | Required | Description            |
| ----------------------- | ----------------- | -------- | ---------------------- |
| `name`                  | `string \| null`  | No       | New workspace name     |
| `daily_budget_usd`      | `number \| null`  | No       | Workspace daily budget |
| `user_daily_budget_usd` | `number \| null`  | No       | Per-user daily budget  |
| `max_concurrent_runs`   | `integer \| null` | No       | Max concurrent runs    |

### Response `200`

Returns the full updated `WorkspaceResponse`.

### Plan Gating

<Warning>
  Setting `user_daily_budget_usd` requires the **Pro** plan or higher. Basic plan workspaces will receive a `403` error.

  Configuring `max_concurrent_runs` requires the **Pro** plan or higher. Basic plan workspaces are fixed at 3 concurrent runs.
</Warning>

***

## Toggle Kill Switch

```
POST /v1/workspace/kill-switch
```

Enables or disables the kill switch. When active, **all** runs and steps are immediately blocked with `KILL_SWITCH_ACTIVE`.

**Auth**: JWT or API Key

### Request Body

```json theme={null}
{
  "active": true
}
```

| Field    | Type      | Required | Description                          |
| -------- | --------- | -------- | ------------------------------------ |
| `active` | `boolean` | Yes      | `true` to enable, `false` to disable |

### Response `200`

Returns the full updated `WorkspaceResponse` with `kill_switch` reflecting the new state.

### Plan Gating

<Warning>
  The kill switch requires the **Scale** plan or higher. Basic and Pro plans will receive a `403` error when trying to enable it.
</Warning>
