# HTTP and realtime API

bsln version: `0.0.1b40`

SDK source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln`

Page source: `baseline-robotics/engineering@c8db8d9fbc8ce8e0524c5ee45cebdfcec34fc666:robotics/bsln/docs/customer/API.md`

[Read on the web](https://docs.baseline-robotics.com/api/) | [Markdown](https://docs.baseline-robotics.com/api.md) | [Documentation index](https://docs.baseline-robotics.com/llms.txt)

<a id="contract-maintenance"></a>

Send your token as a bearer credential over HTTPS. The [OpenAPI schema](https://docs.baseline-robotics.com/api/openapi.json) describes the wire contract. Your beta permissions determine which operations you can use. See the sessions and account operations below. The [WebSocket event schema](https://docs.baseline-robotics.com/api/events.json) defines stream messages.

## Resources

List robot types. Paste a read-scoped token for the public API at the prompt:

```bash
bash -c '
read -r -s -p "API token: " api_token || exit 1 &&
printf "\n" >&2 &&
[[ -n $api_token ]] &&
printf "Authorization: Bearer %s\n" "$api_token" | curl -fsS -H @- "https://api.baseline-robotics.com/v1/robot-types"
'
```

The OpenAPI document lists fields, ownership and scopes. Use `GET /v1/robot-types` and `GET /v1/tasks` to list station types and tasks. Start sessions with `POST /v1/sessions` and `control` scope. Read session history, reports and ZIP downloads with `read`. Ordinary request bodies default to a 64 KiB limit.

### Built-in task status

A task can be ready, in use, locked, unavailable, or outside your tier. A task outside your tier cannot be quoted or started. SDK session access is separate. A one-session pilot request must omit the environment and supply the assigned `request_id`.

## Requests and errors

### Collection pages

For collections, pass `next_cursor` with the same filters until the response returns a null cursor. A cursor from a different collection, owner or filter returns `422 invalid_cursor`.

### Creating an activity once

To recover a lost `POST /v1/sessions` response, repeat the same body and body `request_id` under the same owner. The response gives the session's current state. `X-BSLN-Request-Replayed: true` means the session already existed. Reusing a key with a changed body returns `409 idempotency_conflict`. The error body's `request_id` identifies an HTTP exchange for diagnostics.

### Errors

Read the HTTP status and response `detail` for the failure. Keep the diagnostic `request_id` when asking for support.

See [session lifecycle and realtime streams](https://docs.baseline-robotics.com/api/lifecycle.md) and [read-only MCP setup](https://docs.baseline-robotics.com/api/mcp.md).
