API keys are region-bound. If you’re using a EU tenant, create your API keys from within your EU tenant at
https://app.eu.endorlabs.com.Create an API key
Create an API key to access Endor Labs services programmatically. You can create an API key either from the user interface or using the Endor Labs API. You can create API keys with an expiry of up to one year from the user interface. Use the API to create keys with longer expiry.Create an API key through the Endor Labs user interface
- Select User menu > Settings from the left sidebar.
- Select Access Control > API Keys.
- Click Generate API Key.
- Enter a name to identify the API key.
-
Select the roles to apply to the API Key.
You can choose from the following options:
- Admin
- Read-only
- Code Scanner
- Policy Editor
- On-Prem Scheduler
- Package Firewall User
- AI Audit User
- Select the expiry of the API key. You can set the value as 30, 60, 90 days, or one year.
- When you create an API key, it applies to the current namespace and all its child namespaces. To prevent the policy from being applied to any child namespace, click Advanced and deselect Propagate this policy to all child namespaces.
Create an API key through Endor Labs API
Run the following command to generate and API with the create API Key endpoint.spec.permissions.roles:
SYSTEM_ROLE_ADMINSYSTEM_ROLE_READ_ONLYSYSTEM_ROLE_POLICY_EDITORSYSTEM_ROLE_CODE_SCANNERSYSTEM_ROLE_PACKAGE_FIREWALLSYSTEM_ROLE_AI_AUDIT
SYSTEM_ROLE_AI_AUDIT for API keys that ship with Coding Agent Governance hooks on developer machines.
See authorization roles for more information.
You can provide a specific value for the expiration date of the token. You can also set an expiry of over one year if required. You cannot edit the expiry after you create the API key. If you want to change the expiry, create a new API key with the required expiry date.
For example, you want to create an API key for a CI/CD pipeline that expires on March 31st 2026.
Run the following command to create an API key with SYSTEM_ROLE_CODE_SCANNER role so that you can use it for endorctl access from a CI/CD pipeline.
API key expiry reminders
Endor Labs sends email notifications before an API key expires so that you can replace the key before your integrations break. Notifications go out 30, 14, 7, 3, and 1 day before the expiry date of a key. You don’t need to set up anything to receive them. Each notification lists the name, key ID, namespace, permissions, and expiry date of every key it covers. Select the name of a key in the email to open that key in the Endor Labs user interface. The following diagram shows who receives a notification for a key. The recipients depend on whether the key records the email address of its creator.- The user who created the key: If the API key records the email address of its creator, that user receives every notification for the key.
- Users with the Admin role: If the API key does not record the email address of its creator, the users with the Admin role receive every notification for the key. They also receive the 3-day and 1-day notifications for keys that do record a creator.
Action Required. A key that you delete or replace drops out of the next notification.
Delete an API Key
Delete the API keys that are expired or no longer in use. You can delete API keys using the Endor Labs user interface or using the Endor Labs API.Delete an API key through the Endor Labs user interface
- Select User menu > Settings from the left sidebar.
- Select Access Control > API Keys.
- Find the API key that you want to delete and click Delete.