Skip to content

Managing API Keys

API keys let integrations (CI pipelines, Terraform, scripts) talk to the DataRecs API without interactive logins. Keys inherit the tenant or workspace roles you assign, so they should be created deliberately and rotated regularly.

  • API keys are created at the tenant level. You decide which platform roles (Owner/Admin) or workspace roles the key should impersonate.
  • Keys are envelope-encrypted and stored in Vault. You will only see the plain value once—copy it somewhere safe.
  • Each key has metadata: name, description, created_by, last_used_at, and whether it’s enabled.
  1. Navigate to Access management → API Keys.
  2. Click New API Key.
  3. Provide a Name and optional Description.
  4. Choose the Role the key should assume (e.g. admin, workspace_admin).
  5. Optionally restrict the key to a specific workspace.
  6. Click Generate.
  7. Copy the generated key value and store it in your password manager / secret store.
  1. Create a new key following the steps above.
  2. Update every system that used the old key (CI, Terraform, scripts) to use the new value.
  3. Once the new key is live, disable and then delete the old key.

You can disable a key temporarily to test without deleting it:

Terminal window
datarecs api-key disable --api-key-id key_abc
datarecs api-key enable --api-key-id key_abc
  • The API Keys page shows last used at and created by metadata.
  • datarecs api-key list prints the same metadata for scripting.
  • Audit logs record every create/update/delete and every request authenticated with a key.
  1. Disable or delete the key immediately via Console/CLI/API.
  2. Review audit logs to understand what actions were taken.
  3. Create replacement keys if necessary.
  4. Consider rotating other credentials if the key had broad access.
  • Prefer least privilege: assign the narrowest role possible.
  • Store keys in a secret manager (Vault, AWS Secrets Manager, GitHub Actions secrets). Never hard-code them.
  • Rotate keys on a schedule (e.g. every 90 days) or whenever staff changes occur.
  • Use different keys for different automation contexts so you can revoke/review independently.
  • Monitor usage: stale keys are a risk—delete keys with no activity.
IssueResolution
401 UnauthorizedEnsure you copied the key exactly. Keys are case-sensitive. Verify it hasn’t been disabled.
Cannot create keyYou need the create_api_key permission (Owner/Admin). Ask your tenant admin.
Exceeded key limitDelete unused keys or contact support to raise the quota.
Forgotten key valueGenerate a new key; existing values cannot be retrieved once generated.