Skip to main content
All requests to the Program API (except health checks) require a Bearer token. For scripts, backends, and CI, use a workspace API key. Browser sessions in the web app authenticate separately through Questra Auth. Claude and other MCP clients use user OAuth, not API keys. API keys are scoped to the workspace that created them. You do not send an organization or workspace header — the key selects the tenant.

Create an API key

You need the api_keys:write permission (workspace owner or admin). Members can view keys but cannot create them.
1

Open the web app

Sign in at program.questra.ai (or program.staging.questra.ai for staging).
2

Go to API keys

Open SettingsAPI keys.
3

Create a key

Click Create key. Give it a name you will recognize later (for example Production backend).
4

Choose scopes

Pick the permissions this key should have. * grants full Program API access for the workspace. For a read-only integration, surveys:read and meta:read are enough to list surveys and call GET /v1/whoami.
5

Copy the secret

The full key is shown once, prefixed qpk_live_. Store it in a secret manager or environment variable. List and get responses only include a key_hint (last four characters).
Treat the secret like a password. Do not commit it to source control or log it. If it leaks, rotate or delete the key immediately.
You can also create keys with POST /v1/api_keys if you already have a key (or a session) that includes api_keys:write. The create response includes data.key once — same as the dashboard.

Use the key

Pass the secret in the Authorization header on every request.
A successful GET /v1/whoami returns the key’s workspace and auth_method: "api_key":
Invalid, disabled, or expired keys return 401. A valid key that lacks a required permission returns 403.

Base URLs

All documented endpoints live under /v1. Health (GET /health) is unauthenticated and sits outside /v1.

Scopes

Each key stores an explicit list of scopes. The API checks them before the handler runs. resource:write also satisfies resource:read. * satisfies every permission. Create requests require a non-empty scopes array — there is no implicit full-access default unless you pass *.

Manage keys

From Settings → API keys, or the API keys resource:
  • DisablePATCH /v1/api_keys/{apiKeyId} with { "enabled": false }. The key stops working without deleting the record.
  • RotatePOST /v1/api_keys/{apiKeyId}/rotate issues a new qpk_live_… secret and invalidates the old one. Scopes stay the same. Copy the new secret immediately.
  • DeleteDELETE /v1/api_keys/{apiKeyId} revokes the key permanently.
Optional expires_at on create or update sets an expiry. Omit or null for a key that does not expire.

Environment variables

Next: Quickstart to list surveys with that key.