Create API Key
You can create an API key to authenticate API requests to Palette. Use the API key to make REST API calls without providing your username and password. The API keys are limited to a single tenant and user. If you are a tenant admin, you can create API keys for any user within the tenant.
Once you create an API key, you cannot view the key again. Save the key in a secure location, such as a password manager. This restrictions applies to both the Palette User Interface and the REST API. When you create an API key, you can set an expiration date for the key. The expiration date can be further customized after the key creation.
Tenant administrators have the ability to create an API on behalf of any user within the tenant. Select the Tenant tab below to learn more about creating an API key as a tenant admin.
Prerequisites
- User
- Tenant
- You must have a Palette account, and you must be logged in.
-
You must have a Palette account, and you must be logged in.
-
Tenant administrator access.
Create API Key
- User
- Tenant
-
Log in to Palette.
-
Navigate to the User Menu, and select My API Keys.
-
Click on Add New API key.
-
Fill out the following input fields:
Input Field | Description |
---|---|
API Key Name | Assign a name to the API key. |
Description | Provide a description for the API key. |
Expiration Date | Select an expiration date from the available options. You can also specify a custom date by selecting Custom. |
-
Click the Generate button.
-
Copy the API key and save it in a secure location, such as a password manager.
Ensure you save the API key in a secure location. You will not be able to view the API key again.
-
Log in to Palette as a tenant admin.
-
Switch to the Tenant Admin scope
-
Navigate to the left Main Menu and select Tenant Settings.
-
From the Tenant Settings Menu, select API Keys.
-
Click on Add New API key.
-
Fill out the following input fields:
Input Field | Description |
---|---|
API Key Name | Assign a name to the API key. |
Description | Provide a description for the API key. |
User Name | Select the user to assign the API key. |
Expiration Date | Select an expiration date from the available options. You can also specify a custom date by selecting Custom. |
-
Click the Generate button.
-
Copy the API key and save it in a secure location, such as a password manager. Share the API key with the user you created the API key for.
Ensure you save the API key in a secure location. You will not be able to view the API key again.
Validate
- User
- Tenant
-
Log in to Palette.
-
Navigate to the User Menu, and select My API Keys.
-
Verify your API key is listed in the table.
-
Test your API against the Palette API. Issue the command below in your terminal, replace
PLACE_YOUR_API_KEY_HERE
with your API key.
API_KEY=PLACE_YOUR_API_KEY_HERE
- Use
curl
to send the HTTP request to the Palette API using your API key.
curl --location 'https://api.spectrocloud.com/v1/apiKeys' \
--header 'Accept: application/json' \
--header "apiKey: $API_KEY"
-
Log in to Palette as a tenant admin.
-
Switch to the Tenant Admin scope.
-
Navigate to the left Main Menu and select Tenant Settings.
-
From the Tenant Settings Menu, select API Keys.
-
Verify the API key is listed in the table with the correct user name and expiration date.