Skip to main content
API keys authenticate every request to the Cactal API and MCP server. A key acts on behalf of your organization or specific websites, with a role that limits what it can do.

Create your first key

Create your first key in the dashboard, in your organization’s API keys settings. Choose a name, an access scope, and an optional expiry.
The plaintext key is shown once, at creation. Cactal stores only a SHA-256 hash and cannot show it again. Copy it immediately and store it in a secret manager. If you lose it, rotate the key to get a new secret.
Export the key in your shell so the examples across these docs work as written:

Choose an access scope

A key carries one of two access shapes. Pick the narrowest one that can do the job — especially for agents. Roles map to capabilities:
  • content_editor — edit CMS content and assets; no source code edits, publishing, or settings.
  • full_editor — everything content editors can do, plus source code, publishing, and domains.
  • admin — organization-scoped keys only; adds member, website, and key management.
The owner role cannot be granted to an API key, and every billing operation requires it — so billing stays with human owners in the dashboard.

Create keys programmatically

Once you have one key (or a dashboard session), you can create more over the API — useful for issuing per-agent or per-client keys:
Create a website-scoped key
The response includes the key record and plaintextKey — the only time it is returned:
Response (abridged)

Use the key

Send the key as a bearer token on every request:
The same header authenticates the MCP server at POST https://api.cactal.ai/v1/mcp.

Key safety

  • Store keys in a secret manager or environment variable. Never commit them.
  • Scope agent keys to specific websites with the lowest workable role — see Agent-safe publishing.
  • Rotate on any suspicion of exposure: POST /v1/apiKeys/{apiKeyId}/rotate returns a new secret and invalidates the old one immediately.
  • Revoke keys you no longer need: POST /v1/apiKeys/{apiKeyId}/revoke. Revocation is permanent.
  • Set expiresAt for keys that should not outlive a project.
Full lifecycle workflows live in Manage API keys. The wire-level details are in Authentication.

Next steps

Quickstart

Use your key to create and publish your first website.

Connect your agent

Give an MCP client scoped access to Cactal.