REST API
Everything the console can do is a JSON endpoint under https://camplax.dev/v1 — which credential to use, and where the surface is split.
The console is a client of the same API you can call. The base is https://camplax.dev/v1; GET /v1/ returns a small index. This page is the map — pick the right credential, find the route family, and the per-feature docs cover the shapes.
Which credential
| Prefix | Carried as | What it reaches |
|---|---|---|
| (session cookie) | browser sign-in | everything the console can do, including the session-only routes below |
cx_cli_… | Authorization: Bearer | your user — projects, deploys, CLI flows, /v1/mcp; set via camplax login or CAMPLAX_TOKEN |
cx_live_… / cx_test_… | Authorization: Bearer | one project's data surface, limited to the key's scopes |
cak_live_… | Authorization: Bearer or x-camplax-analytics-key | the write-only ingest routes only — analytics, errors, flags |
cxm_… | Authorization: Bearer | the MCP endpoint, minted by OAuth |
Three things follow. Session-only routes — team admin, billing, deploy-hook management — refuse project API keys outright. cx_live_ keys work on project routes and on the MCP endpoint for project-scoped tools (they cannot create_project, import_project or probe_project, and /v1/cli refuses them). And public ingest keys cannot read anything back.
The route map
Account-level:
| Family | Covers |
|---|---|
/v1/projects · /v1/imports · /v1/templates | create, import and template projects |
/v1/cli | CLI session — whoami, device login |
/v1/billing | summary across projects, credits/:slug wallet + ledger |
/v1/uploads · /v1/mcp | upload tokens · the MCP transport |
/v1/integrations/github | connect repos |
Per-project, all under /v1/projects/:slug/:
| Family | Covers |
|---|---|
probe · deploys · import · deletion | health checks, builds and rollback, moving in or out |
database · storage · users · settings · email | the data layer and its knobs |
keys · teams · domains | API keys, seats, custom domains |
logs · errors · error-alerts · uptime | the observe surface — streams, issues, monitors |
analytics · flags · widgets · realtime | product telemetry, feature flags, hosted widgets, realtime channels |
webhooks · cron · payments · integrations · ai · lee | outbound events, schedules, Stripe Connect, third-party keys, the AI gateway, the console assistant |
GET /v1/projects/:slug itself is the dashboard rollup.
Public and inbound surfaces
Some routes answer without any of your credentials — they are public by design and rate limited:
| Route | Purpose |
|---|---|
POST /v1/analytics/i · POST /v1/errors/i | telemetry ingest keyed by cak_live_… |
GET /v1/flags/i | flag evaluation, keyed by cak_live_… |
GET /v1/status/:slug | public uptime JSON for a project's status page |
GET /v1/deploy-logs/:slug/:deployId?token=… | shareable deploy log |
GET /v1/realtime · /v1/w/* | realtime handshake · public widget assets |
POST /v1/hooks/:token | deploy webhooks — 202 + deployId, 401 on a bad x-camplax-signature/x-hub-signature-256, 409 while production is busy |
POST /v1/webhooks/{github,stripe,stripe/connect,resend} | inbound events — the signature header is the auth; replays are deduplicated |
There is also a small POST /v1/logs/ingest family the tenant runtime uses to ship runtime logs — see Logs. /v1/ai is the public AI gateway endpoint your app calls with a project key.
Shape of a response
Everything is JSON. Successes return the resource; failures return a machine-readable code first, with a human string when it helps:
{ "error": "not_found" }
{ "error": "invalid_signature" }
{ "error": "production_deploy_busy", "activeDeployId": "dep_…" }
{ "error": "delta_required" }
Treat error as the contract and message as display text. Public surfaces rate-limit by caller — an 429 means back off, not retry harder.
Related docs
- API keys — scopes, expiry, and which token goes where.
- Agents and MCP — the OAuth-flavoured way in for AI clients.
- CLI reference — the same verbs with
--jsonfor scripts.