🔑Generating an API key

Generate an API key to use the P0 Management API or install P0 via Terraform.

API keys allow you to authenticate with P0's Management API and integrate P0 into your infrastructure-as-code workflows. You need an API key to:

Prerequisites

You must have the Owner role in your P0 organization to generate API keys.

Generate an API key

  1. Navigate to P0 Management > API Keys in the P0 dashboard.

  1. Click Create a new API Key.

  1. Enter a descriptive name for the key (for example, "Terraform CI/CD" or "Management API").

  2. Click Submit.

  1. Copy the API key somewhere safe. Copy your API key now. The API key is only displayed once at creation time. You cannot retrieve it later. If you lose the key, you must generate a new one.

  2. Click OK.

Using the API key

With the Management API

Include the API key in the Authorization header of your API requests:

With the Terraform provider

Configure the P0 Terraform provider with your API key:

For more information, see the P0 Terraform Provider documentationarrow-up-right.

Best practices

  • Use descriptive names for your API keys to identify their purpose.

  • Rotate keys regularly as part of your security hygiene.

  • Store keys securely using a secrets manager or environment variables. Never commit API keys to version control.

  • Delete unused keys to minimize your attack surface.

Last updated