How to Create API Keys
Prerequisites
- For an overview of the Identities feature, refer to the section: Overview/Introduction/Concepts
Configuration
-
Log in to the Cyolo admin portal.
-
Navigate to the Identities > API Keys page.
-
Click the Add button in the top right corner of the page.
-
Enter a name for the key. Make sure the name describes the function or purpose of the key.
-
Click Create.

-
A new window displays the following information:
a. Key ID: A 128-bit key in hexadecimal format.
b. Secret key: A 128-bit key in hexadecimal format.
c. Authorization header: A base64-encoded string for Basic authentication.
-
Click the copy icon to copy all three of the above, and store them securely.
-
Click Close to close this window. Once the window is closed, although the key ID will be displayed on the portal, the secret key is hidden.

Note: API keys cannot be retrieved after it is generated. If you require retrievable API keys, store them on the Vault > Secrets page.
To delete the key, hover your mouse over the key and click the delete icon.

Adding API keys to Applications
An API key created on the API Keys page is authorized to access the Cyolo Application Portal. To authorize the key to connect to applications, the key must be added within applications on the Applications page on the admin portal. API Keys can be assigned at the application or category level.

-
Navigate to the Applications page.
-
Edit an existing application or category, or create a new one.
-
On the Identities section, click the drop-down and select Specific identities.
-
Click inside the search box and click the API keys tab.
-
Select the API key created before.
-
Save the application or category.
Assigning roles to API keys
Similar to users and user groups, roles can be assigned to API keys. The following is an example of assigning the super admin role to an API Key.
-
Navigate to the Roles > Admin page.
-
Click the Edit icon of Super Admin.
-
Click the search bar under Identities.
-
Click the API key tab.
-
Select the API key to be assigned the role.
-
Click Save.

Accessing User Details using API Key Authentication
To test if the API key is working, use an API client to connect to the resource. Here is an example of fetching a session using cURL:
This is the authentication key copied from Identities > API Keys page.
Enter the following command:
- For "auth_key" - enter the API key
- For BASE URL - for example,
https://console.domain.cyolo.io/v1/sessions
curl -s -L -X GET -H "Authorization: <auth_key>" <BASE_URL> -H 'accept: application/json' -H 'Content-Type: application/json'
If the command is entered correctly, you will see a similar output on the screen:

Updated 3 days ago