Skip to content

Authentication

The Lexcel public API authenticates with API keys. Each key belongs to one organization and carries a set of scopes that control which endpoints it can call. A key is either workspace-bound (limited to a single workspace) or org-scoped (can act on any workspace its creator can access).

https://api.lexcel.ai/public

All resources are versioned under /v1. The interactive API Reference is generated from the live OpenAPI spec at https://api.lexcel.ai/public/openapi.json.

API keys are created from within the Lexcel app. You need the Manage workspace privilege on the target workspace.

  1. Open the workspace you want the key to access.
  2. Go to Settings → API Keys.
  3. Click Create key, give it a name, and select the scopes it needs.
  4. Copy the key immediately — the full value is shown only once.

Keys look like:

lxcl_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Send the key as a Bearer token in the Authorization header:

Terminal window
curl https://api.lexcel.ai/public/v1/org \
-H "Authorization: Bearer lxcl_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

Resolve which org and workspace(s) the key can reach before calling workspace-scoped endpoints:

  1. GET /v1/org — confirms which organization the key belongs to.
  2. GET /v1/workspaces — lists the workspace(s) the key can access (one for a workspace-bound key, potentially several for an org-scoped key); note the workspaceId.
  3. Use that id in the path of every workspace-scoped call, e.g. POST /v1/workspaces/{workspace_id}/query.

Requesting a workspace the key cannot access returns 403.

Each key carries one or more scopes. Grant only what an integration needs.

ScopeGrants access to
workspaces:readGET /v1/org, /v1/workspaces, /v1/workspaces/{id}, .../projects
documents:readGET /v1/workspaces/{id}/documents (document tree)
documents:writePOST /v1/workspaces/{id}/documents (upload)
query:runPOST /v1/workspaces/{id}/query (agent query)

A request to an endpoint whose required scope the key lacks returns 403 Forbidden with a detail explaining which scope is missing.

Requests are rate limited per API key (default 100 requests/minute). When exceeded, the API returns 429 Too Many Requests with a Retry-After header (seconds until the window resets).

StatusMeaning
401Missing or invalid API key
403Key revoked/expired, missing scope, or wrong workspace
429Rate limit exceeded — retry after the Retry-After interval
503Temporarily unavailable (e.g. capacity) — retry after Retry-After

Error bodies are JSON: { "detail": "..." }.