API Key Scopes & Workspace Binding
Every DraftLift API key carries two governance fields beyond its name:- Scopes — what the key can do (
read,write). - Workspace binding — which workspace the key operates against (a specific workspace, or all of them).
Scopes
Scopes are additive. A key with
["read", "write"] is the most permissive issuable today; a read-only key is read-only across the entire API.
The admin scope is reserved in the schema but is not surfaced in the UI. v1 keys cannot manage other API keys, billing, or admin endpoints — those operations always require an interactive web session and are denylisted on the public API. See Authentication for the full denylist.
When to issue a read-only key
Useread-only keys for:
- Reporting dashboards, analytics jobs, or anything that only consumes existing content.
- Long-lived background services that should never mutate state if they get compromised.
- Sharing data with third-party tooling.
When to include write
Use read + write keys for:
- AI agents that generate, edit, score, or schedule content.
- CI/CD pipelines that publish or convert drafts.
- The CLI on a developer laptop.
read + write because most CLI/MCP usage requires both. Untick Write to harden a key meant for read-only consumers.
Insufficient scope errors
A scope-gated mutation called with aread-only key returns:
InsufficientScopeError with exit code 2 and prints the upgrade_action URL on its own line.
Workspace binding
Workspaces partition references, memories, content calendars, and generated drafts. A workspace is identified by its UUID (ws_...).
When you create a key, you choose one of two postures:
If you have exactly one workspace, the create dialog hides the workspace picker and binds the key to that workspace automatically.
Behavior at request time
Workspace mismatch errors
WorkspaceMismatchError (exit code 2) and suggests either re-issuing the key without a binding or running with --workspace <bound>.
Choosing settings for common scenarios
Rotation and expiry
When you create a key, pick an expiration: 30 days, 90 days (default), 365 days, or Never. The default is 90 days because it forces a yearly-quarterly rotation cadence without being onerous; pickNever only for keys you actively monitor in audit logs.
To rotate:
- Create a new key with the same scopes and binding.
- Roll the key into your config or secret store.
- Revoke the old key from Settings → API Keys.
401 Unauthorized within seconds.
Introspecting a key
You can check what a key can do at any time:name, scopes, workspace_id, expires_at, and last_used_at. It is the only /api-keys/* endpoint that accepts dl_live_ keys — every other key-management operation requires a web session.
Next steps
CLI Quickstart
Walk through
dl login, references, and your first generation.Authentication
Full reference for keys, headers, error shapes, and the denylist.