Developer API

Developers
intermediate
5 min read

Connect your own applications to ContextLab with scoped, workspace-bound API keys.

Developer API

The Developer API lets external applications read ContextLab resources — workspaces, projects, project context, blueprints, and libraries — using scoped API keys.

CLI tokens (ctxlab login) and IDE integrations are unchanged. Developer API keys are for your own apps, agents, and services.

Authentication

Create a key in Integrations → API & Access → Developer API. The secret is shown once — store it like a password.

Send it as a Bearer token:

curl https://context.web.id/api/public/v1/workspaces \
  -H "Authorization: Bearer ctxk_xxxxxxxx_xxxxxxxx"

Keys are bound to a single workspace and a set of scopes. A key can never read resources from another workspace, even if the ID is known.

Scopes

ScopeGrants
workspace:readList and read the bound workspace
project:readList projects in the workspace
context:readRead composed project context (CONTEXT.md)
blueprint:readList and read blueprints
library:readList unlocked libraries

All scopes are read-only. Write scopes are not exposed.

Endpoints

Base URL: https://context.web.id/api/public/v1

EndpointScopeDescription
GET /workspacesworkspace:readThe bound workspace
GET /projectsproject:readProjects in the workspace
GET /projects/:id/contextcontext:readComposed context document (markdown)
GET /blueprintsblueprint:readBlueprints in the workspace
GET /blueprints/:idblueprint:readA single blueprint
GET /librarieslibrary:readLibraries unlocked by the key owner

Errors

StatusMeaning
401Missing, invalid, expired, or revoked key
403Key lacks the required scope
404Resource not found in the bound workspace

Error bodies never include the key material.

Usage & Limits

API requests count toward your existing plan usage and appear in Activity. Keys track last_used_at and a request counter, visible in the Developer API panel. Optional expiration dates are supported.

Revocation

Revoke a key at any time from Integrations → Developer API. Revocation is immediate — the next request with that key returns 401.

AI Operations

If an API-driven operation invokes AI, it flows through the existing AI Gateway with your plan entitlements, credits, and BYOK settings — the API never bypasses them.