Using the Komodor API 🔑

Komodor APIs empower users to manage account-level settings and easily gain insights into their workloads' current state. By leveraging API keys, you can automate workflows, retrieve real-time information, and integrate Komodor's powerful observability tools into your existing systems. 

API keys are private credentials and inherit the complete set of permissions associated with the user who generates them. 

Users with the manage:users permission can view, delete, and manage all API keys within their organization.


How to Generate a New API Key

Follow these steps to create a new API key:

  1. Log in to Komodor:
    • Navigate to the Komodor dashboard and log in with your account credentials.
  2. Access API Key Management:
    • Click on your account profile or settings in the top-right corner of the dashboard.
    • Select API Keys from the dropdown menu.
  3. Create a New Key:
    • Click the Generate Key button.
    • Provide a descriptive name for the API key to help you identify its purpose later (e.g., "CI/CD Pipeline Access").
  4. Save the Key:
    • Once generated, the API key will be displayed.
    • Store the API key securely in a secrets manager or an environment variable.

How to Use the API Key

Once you've generated your API key, you can use it to authenticate API requests:

  1. Add the API Key to Your Requests:
    • Include the API key in the X-API-KEY header of your HTTP requests:
      curl -X 'GET' \
        'https://api.komodor.com/mgmt/v1/monitors/config' \
        -H 'accept: application/json' \
        -H 'X-API-KEY: <your_api_key>'
  2. Access the API Documentation:

Managing API Keys

Configuring API Key Expiration

API key expiration is an account-level setting that automatically assigns an expiration time (in days) to every newly created API key. Users with the manage:users permission can configure this setting. Key details include:

  • Existing API Keys: All existing API keys will be set to non-expiring.
  • Expired Keys: Once expired, API keys will stop working.
  • Edit Expiration: Users with the manage:users permission can remove the expiration for specific API keys if needed by clicking the edit button and removing the expiration.

How to Enable and Configure API Key Expiration:

  1. Navigate to the API Keys Screen:
    • Log in to the Komodor dashboard and go to the API Keys section.
  2. Configure Expiration Settings:
    • Click on the Configure API Keys button.
    • Toggle the Turn on API Key Expiration Time (TTL) option.
    • Set the expiration time in days and click OK.
  3. View Expiration Details:
    • A new column, Expired At, will appear in the table for all users, showing the expiration date of each API key.

Was this article helpful?

0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.