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 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 necessary permissions can manage keys. Users 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.

ℹ️

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.

Create 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 one. For information about the scopes required for each endpoint, refer to the section API key scopes.

    Create an API Key
  6. Select Create API Key.

  7. Copy the API key displayed. It will not be shown again.

    Copy the API key
  8. Select Close.

New keys are Enabled by default.

Edit an API key

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

  1. On 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. For information about the scopes required for each endpoint, refer to the section API key scopes.

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

CloudZero displays the updated list of API keys.

Enable or disable an API key

To disable or enable an API key:

  1. On 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 on the API Keys page
  3. Select Enable or Disable.

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

Delete an API key

⚠️

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

To delete an API key:

  1. On 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: