Skip to content
Last updated

Manage API keys

Products:RedocRedocRevelRevelReefReefRealmRealm
Plans:ProEnterpriseEnterprise+

An API key is a unique identifier used to authenticate a user, developer, or an application to an API. You can add API keys to your organization and revoke them when you are finished using them.

If you don't set an expiration date when you create a key, the key does not automatically expire and stays valid until manually revoked.

Redocly stores API keys as one-way cryptographic hashes in the backend. The plaintext value of the key can't be retrieved.

Add API keys

You can add API keys to your organization if you need to access the Redocly API or the Scout tool.

To add an API key:

  1. Log in to your Redocly instance.
  2. Select API keys in the navigation menu on the left side of the page.
  3. Click New key.
  4. Enter a Name for your key.
  5. Choose a Permission model for the key and set the permissions it grants. For details on each model and the available permissions, see API key permissions.
  6. (Optional) Set an Expiration date. After this date (UTC), the key stops working. Leave it empty to create a key that stays valid until you revoke it.
  7. (Optional) Restrict the key to one or more allowed IP addresses. This option is available on plans that include IP restrictions.
  8. Click Create.
  9. Click the copy icon next to the newly created API key to save it to your clipboard. Save the key somewhere safe, as you can't access it again later.

API key permissions

Every API key has a permission model that determines what the key is allowed to do. You select the permission model when you create a key, and you can change it later by editing the key.

The API keys list shows the permission model for each key in the Permission model column.

Permission models

Permission modelDescription
Granular permissionsGrant the key a specific set of organization and project permissions that you select individually. Use this model when you want to scope a key to only the operations it needs.
RBACAssign the key to one or more teams. The key inherits the roles and permissions of those teams, following the same role-based access control logic that applies to users.
Legacy full accessA read-only model shown for older keys that were created with unrestricted access. You can't create new keys with this model. To save changes to a legacy key, convert it to Granular permissions or RBAC.

Granular permissions

When you select the Granular permissions model, you choose from a list of organization permissions and a list of project permissions. You must select at least one permission.

Each permission has a type that describes the kind of access it grants:

  • Read permissions allow viewing or listing resources.
  • Write permissions allow creating or updating resources.
  • Delete permissions allow removing resources.

Use the Quick select buttons above each list to set permissions in bulk:

  • Full access selects every permission in the list.
  • Read only selects only the read-type permissions in the list.
  • None clears the selection.

Organization permissions

PermissionTypeGrants
org.organizations.readReadView organization details and settings.
org.organizations.updateWriteUpdate organization details and settings.
org.project.readReadList and view projects in the organization.

Project permissions

PermissionTypeGrants
project.git.branch.deleteDeleteDelete branches in a project.
project.git.branches.readReadList and view branches in a project.
project.remotes.createWriteCreate project remotes.
project.remotes.deleteDeleteDelete project remotes.
project.remotes.readReadList and view project remotes.
project.remotes.updateWriteUpdate project remotes.

RBAC permission model

When you select the RBAC model, you assign the key to one or more teams instead of selecting individual permissions. The key is granted the same access as a member of those teams, following the roles assigned to them.

The access logic follows the same principles as standard RBAC configuration. API keys assigned to a team have access to the resources that the team's roles allow.

Revoke API keys

When you are finished using an API key, you can revoke the key, making it an invalid authentication method.

  1. Log in to your Redocly instance.
  2. Select API keys in the navigation menu on the left side of the page.
  3. Click More options next to the API key you want to revoke, then click Revoke.
  4. Confirm that you want to revoke the key.

Resources