# API Reference

LaserData Cloud provides a main API and regional Supervisor APIs. Programmatic requests use an `ld-api-key` header with a key whose role permits the operation.

These APIs manage resources, configuration, and monitoring. For application messages, queries, and agents, use [laser-sdk](/laser-sdk) in Rust, Python, or TypeScript.

## Base URLs

| API | Base URL | Purpose |
| --- | --- | --- |
| Main API | `https://api.laserdata.cloud` | Organization, deployments, API keys, billing, notifications, and audit records |
| Supervisor API | `{supervisor_url}` | Deployment operations: configs, networking, metrics, logs, diagnostic snapshots, data backups |

[List Organization Deployments](/api/deployments#list-organization-deployments), [List Deployments](/api/deployments#list-deployments), and [Get Deployment](/api/deployments#get-deployment-main-api) return each deployment's `supervisor_url`. An example is `https://supervisor-aws-us.laserdata.cloud`.

## OpenAPI Schema

The operations an API key may call are also tools on the [MCP servers](/mcp), named by their `operationId`. Operations that need a console session, and account and operator routes, are not tools. When two services share an operation name, the later service's tool gets its name as a prefix, such as `audit_get_deployment`.

Each public service provides an OpenAPI 3.1 specification and browser, with request and response examples.

Agents and generators can start at [`https://laserdata.com/openapi.json`](https://laserdata.com/openapi.json), the Core management API specification. Individual service specifications are also available:

| Service | Machine-readable schema |
| --- | --- |
| Core | [`https://laserdata.com/openapi/core.json`](https://laserdata.com/openapi/core.json) |
| Audit | [`https://laserdata.com/openapi/audit.json`](https://laserdata.com/openapi/audit.json) |
| Notifier | [`https://laserdata.com/openapi/notifier.json`](https://laserdata.com/openapi/notifier.json) |

Each operation has a stable, unique `operationId`, description, typed parameters, and typed responses. For an LLM function tool, use `operationId` as its name. Use the description as guidance and request parameters or body schema as inputs. Send credentials only to the declared LaserData service base URL.

### Main, Audit, Notifier

Open <a href="https://api.laserdata.cloud/docs" target="_blank" rel="noreferrer">api.laserdata.cloud/docs</a> and use the dropdown to select Core, Audit, or Notifier.

### Supervisor (per region)

Each cloud and area has a supervisor specification at `/docs`:

| Cloud | US | EU | AP |
| --- | --- | --- | --- |
| AWS | <a href="https://supervisor-aws-us.laserdata.cloud/docs" target="_blank" rel="noreferrer">supervisor-aws-us</a> | <a href="https://supervisor-aws-eu.laserdata.cloud/docs" target="_blank" rel="noreferrer">supervisor-aws-eu</a> | <a href="https://supervisor-aws-ap.laserdata.cloud/docs" target="_blank" rel="noreferrer">supervisor-aws-ap</a> |
| GCP | <a href="https://supervisor-gcp-us.laserdata.cloud/docs" target="_blank" rel="noreferrer">supervisor-gcp-us</a> | <a href="https://supervisor-gcp-eu.laserdata.cloud/docs" target="_blank" rel="noreferrer">supervisor-gcp-eu</a> | <a href="https://supervisor-gcp-ap.laserdata.cloud/docs" target="_blank" rel="noreferrer">supervisor-gcp-ap</a> |

Specifications declare `ld_api_key` and `session_cookie`. User-session endpoints explicitly require cookies and reject API keys. See [Authentication](/api/authentication#api-keys-vs-console-sessions).

## Authentication

For API-key authentication, include `ld-api-key`:

```bash
curl https://api.laserdata.cloud/tenants/{tenant_id}/api_keys \
-H "ld-api-key: YOUR_API_KEY"
```

[Authentication](/api/authentication) explains scopes, security, and error responses.

## Pagination

List endpoints accept these pagination parameters:

| Parameter | Default | Description |
| --- | --- | --- |
| `page` | `1` | Page number (1-indexed) |
| `results` | `10` | Items per page (max 100) |

Paginated bodies include `items`, `page`, `total_results`, and `total_pages`. The RFC 8288 `Link` header provides `rel="first"`, `prev`, `next`, and `last` URLs. Clients can follow those links without parsing pagination fields.

## IDs

Organization, workspace, environment, deployment, and other IDs are unsigned 64-bit integers, written as JSON numbers. Many are larger than 2^53, the largest integer a JavaScript number holds exactly, so `JSON.parse` and `response.json()` change them and the next call with that ID answers `404`. In JavaScript and TypeScript, keep large numbers as text with a `JSON.parse` reviver that reads the source text, or a JSON parser with big integer support. Python, Rust with `serde_json`, and `jq` 1.7 or later read them exactly.

## Request and Response Headers

| Header | Direction | Purpose |
| --- | --- | --- |
| `ld-api-key` | request | API key bearer credential (see [Authentication](/api/authentication)) |
| `idempotency-key` | request | Optional client-supplied key (max 255 chars) that makes `POST`, `PUT`, and `PATCH` requests safe to retry. See [Idempotency](#idempotency) |
| `ld-request` | response | Correlation ID for this request. Mirrored as `instance` in problem+json error bodies. Include it in support requests |
| `idempotent-replayed` | response | `true` when the response was served from the idempotency cache instead of re-running the handler |
| `link` | response | Pagination links (`first`, `prev`, `next`, `last`) on paged list responses |
| `retry-after` | response | Seconds to wait before retrying. Sent on `429` and on transient `5xx` |
| `ld-tenant`, `ld-workspace`, `ld-environment`, `ld-deployment`, `ld-role` | response | Created-resource ID headers, set on the matching `POST` endpoint when the new resource is created |

## Idempotency

`POST`, `PUT`, and `PATCH` accept optional `idempotency-key` for safe retries. The platform caches the first response for each `(api_key, idempotency-key)` pair for 10 minutes. Repeating the same body with the same key returns that response with `idempotent-replayed: true`. The handler does not run again.

* This feature applies to API-key authentication. Console sessions do not use it.
* A repeated key with a different body returns `409 Conflict` and `code: idempotency_error`.
* A retry while the original request runs returns `409 Conflict` and `code: idempotent_request_in_progress`. Wait briefly before retrying.
* `DELETE` is excluded because repeated deletion already has the same effect.
* Audit has no endpoints that change state and does not advertise idempotency support.

Use the same request identity after network failures, CI retries, or queue redelivery, including when creating deployments.

## Quick Start

Create a Free single-node deployment, then retrieve its details and credentials:

```bash
# 1. Create a starter deployment (Free, single node on shared infrastructure)
curl -X POST https://api.laserdata.cloud/tenants/{tenant_id}/workspaces/{workspace_id}/deployments/starter \
-H "ld-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "cloud": "aws",
  "region": "us-west-1"
}'

# Response headers contain the created resource IDs:
# ld-environment: <environment_id>
# ld-deployment: <deployment_id>
```

```bash
# 2. Get the deployment (once provisioned)
curl https://api.laserdata.cloud/tenants/{tenant_id}/workspaces/{workspace_id}/environments/{environment_id}/deployments/{deployment_id} \
-H "ld-api-key: YOUR_API_KEY"
```

```bash
# 3. Get connection credentials
curl {supervisor_url}/deployments/{deployment_id}/credentials \
-H "ld-api-key: YOUR_API_KEY"
```

The credentials response holds `connection_string` for the deployment admin `ld-admin`, ready for Laser SDK and Iggy clients. It adds the root login only for a caller that also holds `deployment:manage`. See [Get Deployment Credentials](/api/deployments#get-deployment-credentials).

To find an existing deployment from an API key alone, [List Organization Deployments](/api/deployments#list-organization-deployments) returns every deployment the key can read in one call: `GET https://api.laserdata.cloud/tenants/{tenant_id}/deployments`.

## HTTP Status Codes

| Code | Meaning |
| --- | --- |
| `200 OK` | Request succeeded |
| `202 Accepted` | Request accepted. Operation will complete asynchronously |
| `400 Bad Request` | Invalid parameters or request body |
| `401 Unauthorized` | Missing or invalid API key |
| `403 Forbidden` | API key valid but lacks required permission |
| `404 Not Found` | Resource does not exist |
| `409 Conflict` | Resource already exists or state conflict |
| `429 Too Many Requests` | Rate limit exceeded |
| `500 Internal Server Error` | Unexpected server error |

## API Sections

- [Authentication](/api/authentication): Headers, scopes, errors, and key rotation
- [Organization](/api/organization): Tenants, workspaces, and environments
- [Members & Roles](/api/members): Users, roles, and invitations
- [Deployments](/api/deployments): Create, configure, and manage deployments
- [Configuration](/api/configuration): Iggy configs, connector configs, and tasks
- [Connectors](/api/connectors): Activate and manage connector instances
- [Networking](/api/networking): VPC peering, PrivateLink, PSC, and access rules
- [Observability](/api/observability): Metrics, heartbeats, and log streaming
- [Activities](/api/activities): Runtime actions: restart, reload
- [Snapshots](/api/snapshots): Diagnostic HTML reports per node
- [Backups](/api/backups): Point-in-time storage volume backups (experimental)
- [Notifications](/api/notifications): Channels and event subscriptions
- [Audit](/api/audit): Immutable audit log and compliance exports
- [API Keys](/api/api-keys): Create and manage programmatic access keys
- [Cloud Accounts](/api/cloud-accounts): BYOC cloud account registration
- [Billing](/api/billing): Billing info, invoices, and payment methods

Source: https://docs.laserdata.com/api
