ReferenceAccount
API keys
Create, scope, rotate, and revoke organization API keys for CI pipelines and non-interactive CLI or MCP sessions.
Organization API keys (ef_org_...) authenticate the Endform CLI and local MCP server without an interactive browser login. Each key is bound to one organization and scoped to the permissions you select.
For GitHub Actions test runs, prefer passwordless GitHub Actions OIDC. For local development, use npx endform@latest login. Neither requires creating an organization API key.
Create an organization API key
Creating, editing, disabling, or deleting organization API keys requires the Admin or Owner role. Any organization member can view the key list, permissions, and last-used timestamps.
-
CLI: Run
npx endform@latest api-key createwith a descriptive name. The command prints only the raw key to stdout so you can pipe it straight into your CI secret store without displaying it in your terminal:npx endform@latest api-key create --name "GitHub Actions" | gh secret set ENDFORM_API_KEYKeys created from the CLI receive the default permissions (Run tests and Manage quarantine rules). You can add or remove permissions afterward in the dashboard.
-
Dashboard: Open Settings -> API Keys, click Create API key, enter a name, select the required permissions, and copy the key immediately. Keys are shown only once at creation time.
Permissions
Each managed organization API key grants only the capabilities you select:
| Permission | Default | What it allows |
|---|---|---|
| Run tests | Yes | Run test suites on Endform, including uploading test files and results. This is the only permission standard CI test jobs need. |
| Manage quarantine rules | Yes | Create, edit, and deactivate quarantine rules through the CLI or MCP server. |
| Read analytics | No | Query past runs and results through the analytics CLI or MCP server. |
| Download traces | No | Download traces and artifacts from past runs. |
| Upload traces | No | Upload traces from Playwright runs that did not execute on Endform. |
To change a key's permissions later, open Settings -> API Keys and select Edit API key permissions on that row. Legacy keys created before granular permissions were introduced show a Legacy badge and have fixed permissions.
Where to use an API key
Pass the key in the ENDFORM_API_KEY environment variable:
- CI pipelines: Required for non-GitHub CI providers (GitLab CI, CircleCI, Azure Pipelines, Bitbucket, Buildkite) and optional for GitHub Actions when you prefer a static secret over GitHub OIDC. For a test-only pipeline, grant only Run tests.
- CI agent and analytics jobs: Required when a CI workflow runs the Endform MCP server or CLI analytics, sample, quarantine, or test-attempt inspection commands (GitHub OIDC tokens are scoped to running tests only). Enable Read analytics and, if inspecting traces, Download traces on the key.
- Non-interactive local MCP sessions: Set
ENDFORM_API_KEYin the MCP server's environment instead of runningnpx endform@latest login. Never commit API keys to project-level config files such as.cursor/mcp.jsonor.vscode/mcp.json.
Behavior differences vs. member login
- Organization selection: An organization API key always targets the organization it belongs to.
- Shareable replay links: Replay links generated by
test_attempt_replay(endform test-attempt replay) with an API key expire after 2 hours, whereas links generated by an authenticated organization member remain valid while that member belongs to the organization (up to 1 year).
Disable, rotate, or revoke a key
Manage existing keys in Settings -> API Keys:
- Disable temporarily: Toggle a key off to pause it without deleting it. This is useful when checking whether a key is still in use before deleting it permanently.
- Rotate with zero downtime: Create a new key with the same permissions, update the secret in your CI provider, confirm a run succeeds, and then delete the old key.
- Revoke permanently: Delete the key. Revocation takes effect immediately, and any CI job or local process still using the key receives an authentication error.
Personal CLI keys and connected apps
Organization API keys are separate from your personal credentials:
- Personal CLI keys (
ef_usr_...): Each time you runnpx endform@latest login, Endform creates a personal key tied to that device (hostname, OS, and architecture). View and revoke individual device logins under Your account -> API keys, for example if you replace or lose a laptop. - Connected apps: OAuth grants for remote AI agents and the hosted MCP server appear under Your account -> Connected apps, where you can revoke access immediately.
- Netlify-managed keys: The Netlify extension creates a dedicated per-project key automatically and revokes it when you disconnect the project or uninstall the extension. These keys are not listed in Settings -> API Keys.
Related pages
Last updated