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

> ## Agent Instructions
> Install the Beam CLI, sign in, and connect coding agents to the Beam MCP server with `curl -fsSL https://www.beam.cloud/install | sh`. To also create a VM, run `curl -fsSL https://www.beam.cloud/install | sh -s -- --vm`.
> VMs are persistent Linux machines without GPUs. Defaults: 4 CPUs, 8 GiB of RAM, a 50 GiB disk, Ubuntu 24.04, and a browser desktop. A running VM accrues usage until you stop, pause, or remove it, or until an idle timeout puts it to sleep.
> Stopping a VM keeps its disk and discards RAM and processes. Pausing keeps both, and resuming restores them. To pause after 5 idle minutes and wake on access, run `beam vm update NAME --ttl 300 --idle-action pause --auto-resume`.
> Core VM commands: `beam vm new NAME`, `beam vm ssh NAME`, `beam vm sync NAME ./dir`, `beam vm exec NAME -- CMD`, `beam vm expose NAME PORT --protected`, `beam vm fork NAME NEW_NAME`, `beam vm pause NAME`, `beam vm stop NAME`, `beam vm rm NAME`.
> For GPUs, use a sandbox or a deployed endpoint. Sandboxes are disposable environments that boot in seconds and fork from snapshots.
> Current rates are at https://www.beam.cloud/pricing.

# Workspace REST API

> Apps, deployments, databases, events, and observability

Send your [workspace token](https://docs.beam.cloud/v2/getting-started/authentication.md) as a Bearer token. Start by getting your workspace ID:

```bash theme={null}
curl --fail-with-body https://app.beam.cloud/api/v1/workspace/current \
  -H "Authorization: Bearer $BEAM_TOKEN"
```

Replace `{ws}` below with the response's `external_id`.

## Common Routes

Use `https://app.beam.cloud/api/v1` as the base URL:

| Area | Method and path under `/api/v1` |
| - | - |
| Apps | `GET /app/{ws}`, `GET /app/{ws}/latest`, `GET /app/{ws}/{appId}` |
| Deployments | `GET /deployment/{ws}`, `GET /deployment/{ws}/{deploymentId}` |
| Deployment URL | `GET /deployment/{deploymentId}/url` |
| Lifecycle | `POST /deployment/{ws}/start/{deploymentId}`, `POST /deployment/{ws}/stop/{deploymentId}` |
| Tasks | `GET /task/{ws}`, `GET /task/{ws}/{taskId}`, `GET /task/{ws}/{taskId}/subscribe` |
| Containers | `GET /container/{ws}` |
| Databases | `GET /database/{ws}`, `POST /database/{ws}` |
| Stacks | `GET /stack/{ws}`, `POST /stack/{ws}`, `PUT /stack/{ws}/{stackId}` |
| Logs | `GET /logs/{ws}`, `GET /logs/{ws}/stream` |
| Metrics | `GET /metrics/{ws}/stub-timeseries`, `GET /metrics/{ws}/workspace-timeseries`, `GET /metrics/{ws}/pool-timeseries` |
| Events | `GET /events/{ws}/history`, `GET /events/{ws}/stream` |
| Webhooks | `GET /webhook/{ws}`, `POST /webhook/{ws}` |
| Limits | `GET /workspace/{ws}/limits` |

List responses may be paginated. Use MCP's `api_routes` for the full route list. Its `api` tool substitutes `{ws}` automatically.

For example, list deployments:

```bash theme={null}
curl --fail-with-body \
  "https://app.beam.cloud/api/v1/deployment/$WORKSPACE_ID" \
  -H "Authorization: Bearer $BEAM_TOKEN"
```

## Related Guides

* [Deployment lifecycle and readiness](https://docs.beam.cloud/v2/hosting/deployments.md)
* [Databases and credential rotation](https://docs.beam.cloud/v2/data/databases.md)
* [Stacks](https://docs.beam.cloud/v2/hosting/stacks.md)
* [Logs, metrics, and tasks](https://docs.beam.cloud/v2/operations/observability.md)
* [Webhook payloads and signature verification](https://docs.beam.cloud/v2/operations/webhooks.md)
* [Workspace MCP](https://docs.beam.cloud/v2/operations/mcp.md)

## Handle Errors at Both Layers

Workspace REST errors use HTTP error statuses. The separate gateway API under `/api/v1/gateway` can return HTTP 200 with `ok: false`; check its response body too.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.