Skip to main content

Encrata API keys

API keys are secret credentials used to authenticate your requests. They are unique to your account and must be kept confidential. Every key starts with enc_. You need at least one key to call the Encrata API from code, the CLI, or an AI tool.

Create an API key

Choose the method that fits your workflow.
1

Sign in to the Encrata dashboard

2

Open the API Keys page

3

Click Create API key

4

Name your key

Choose a name that identifies where the key is used, for example Production.
5

Copy and store the key

Copy the enc_ key and store it in a secret manager before closing the dialog.
Revealable keys can be read again with GET /api/account/keys/reveal. Access is limited by workspace permissions.

Use the API key in your code

Authenticate every request by sending your key as a Bearer credential in the Authorization header.
1

Store the key as an environment variable

Keep the key out of your source code. In a Node.js project, store it in a .env file at the project root:
.env
Add .env to your .gitignore so the key is never committed.
.gitignore
2

Send the key in the Authorization header

Read the key from the environment and pass it on every call:

Key behavior

Set a credit limit

Every key can carry a credit limit: a cap on how many credits it is allowed to spend. A key with no limit can spend your full account balance, so a leaked or runaway key drains everything. A capped key stops at its ceiling instead, which contains the damage. Set a cap with POST /api/account/keys/limit:
When a key reaches its limit, requests are rejected with 402 api key credit limit exceeded. Raise the limit or use another key to continue.
Send credit_limit: null to remove the cap. Setting a limit requires a non-readonly role in the active workspace. The maximum value is 2147483647.

Manage your keys

Inspect, rename, pause, and retire keys from the dashboard or the API. A workspace admin can manage other members’ keys in the same workspace.

List keys

See every key with its usage, limit, and last-used time.

Rename a key

Update a key’s display name.

Enable or disable

Temporarily turn a key off without deleting it.

Revoke or delete

Permanently delete a leaked key or soft-disable an unused key.
Known issue: A revoked key can be enabled again with PATCH ?action=enable and revealed with GET /api/account/keys/reveal. Revoked and disabled keys both appear as is_active: false. Permanently delete a leaked key.

Handle common errors

Email API errors use this shape:
Do not retry 400 or 401 responses unchanged. Correct the request or credential first. Retries are appropriate for 429 and 5xx responses.
Keep your API key secret. Do not commit it to version control or expose it in client-side code.

Next steps

  • Quickstart: Make your first lookup in under two minutes.
  • All endpoints: Browse every lookup with request and response schemas.