Authorization

CloudZero uses key-based authorization to secure API access. To authenticate your requests, include your API key in the Authorization header:

curl -X GET https://api.cloudzero.com/v2/insights \
  -H "Authorization: AbCd1234EfGh5678AbCd1234EfGh5678AbCd12"

🚧

NOTE

Note that this is not a bearer token, so there is no Bearer in the Authorization header.

Managing API Keys

An organization can have multiple API keys. To view and manage all API keys for your organization, navigate to Settings > API Keys.

API Keys page in CloudZero Settings

Only users with the Organizer role can manage keys. Organizers can assign each key zero or more API scopes, which grant access to endpoints in the CloudZero API.

The API Keys page displays a list of keys with the following information:

  • Name
  • Description
  • Created By: Email of the user who created it
  • Last Modified: Last update timestamp (UTC)
  • Last Accessed: Last usage timestamp (UTC)
  • Assigned Scopes: Number of granted API scopes
  • Status: Enabled or Disabled

If your organization had an API key before multiple keys were supported, it is listed as Legacy API Key.

📘

Updating API Keys For New Endpoints

CloudZero does not automatically grant access to new API endpoints. When new endpoints are released, Organizers must edit each API key to manually add the necessary scopes.

Creating A New API Key

To create an API key:

  1. Navigate to Settings > API Keys.

  2. Select Create New API Key.

    Create New API Key button

  3. Enter a name for the key.

  4. Enter a description.

  5. Select the appropriate API Key Scopes to assign specific permissions to the key. You must select at least 1.

    Create an API Key
  6. Select Create API Key.

  7. Copy the API key displayed.

    ⚠️

    WARNING

    The API key will not be shown again.

    Copy the API key
  8. Select Close.

New keys are Enabled by default.

Editing An API Key

To edit an API key's name and/or scopes:

  1. From the API Keys page, locate the key you plan to modify.

  2. Select the three-dot icon in the Actions column.

    Select the three-dot icon in the Actions column

  3. Select Edit.

  4. Modify the API Key Name if needed.

  5. Modify the Description if needed.

  6. Select the appropriate API Key Scopes to assign specific permissions to the key.

    Select the appropriate API key scopes
  7. Select Update API Key.

CloudZero displays the updated list of API keys.

Disabling Or Enabling An API Key

To disable or enable an API key:

  1. From the API Keys page, locate the key you plan to modify.

  2. Select the three-dot icon in the Actions column.

    Select the three-dot icon in the Actions column

  3. Select Disable or Enable.

The Status column is updated to display Enabled or Disabled for the key you modified.

Deleting An API Key

⚠️

WARNING

Deleting an API key will immediately revoke access for any services using it.

To delete an API key:

  1. From the API Keys page, locate the key you plan to delete.

  2. Select the three-dot icon in the Actions column.

    Select the three-dot icon in the Actions column

  3. Select Delete.

  4. Type the name of the API key to confirm deletion.

    Type the name of the API key to confirm deletion
  5. Select Delete API Key.

CloudZero displays the message "API Key deleted successfully" and removes the key from the list of keys.

API Key Scopes

CloudZero supports the following API scopes, which correspond to specific API endpoints: