Use this file to discover all available pages before exploring further.
Use API keys to engage with Endor Labs services programmatically and enable any automation or integration with other systems in your environment. You can manage API keys with endorctl or from the Endor Labs user interface.
Instead of using API keys, you can use keyless authentication to authenticate with Endor Labs services. See Keyless authentication for more information. Using keyless authentication eliminates the need to manage API keys and reduces the risk of API key compromise.
Create an API key to access Endor Labs services programmatically. You can create an API key through the Endor Labs user interface or using the Endor Labs API. You can create API keys with an expiry of up to one year from the Endor Labs user interface. You can use the API to generate API keys with longer expiry.
Create an API key through the Endor Labs user interface
Select Settings > Access Control from the left sidebar.
Select 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
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.
Using these credentials, you can configure Endor Labs scans in your CI/CD pipeline, or set up the Endor Labs Visual Studio Code extension. Each session initiated by the API key is valid up to four hours. See scanning with endorctl and use Endor Labs extension in Visual Studio Code for details.
You can use the following values in spec.permissions.roles:
SYSTEM_ROLE_ADMIN
SYSTEM_ROLE_READ_ONLY
SYSTEM_ROLE_POLICY_EDITOR
SYSTEM_ROLE_CODE_SCANNER
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.
endorctl api create -r APIKey --data '{ "meta": { "name": "CI/CD Access API key", "description": "API key for use within the CI/CD pipeline" }, "spec": { "permissions": { "roles": ["SYSTEM_ROLE_CODE_SCANNER"] }, "expiration_time": "2026-03-31T00:00:00Z" }}'