πGenerating an API key
Generate an API key to use the P0 Management API or install P0 via Terraform.
Last updated
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:
Use the Management API to programmatically configure P0 settings
Install and manage P0 using the P0 Terraform Provider
You must have the Owner role in your P0 organization to generate API keys.
Navigate to P0 Management in the P0 dashboard sidebar.
Expand the API Keys section.
Click Create a new API key.
Enter a descriptive name for the key (for example, "Terraform CI/CD" or "Management API").
Click Submit.
Copy the API key immediately.

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.
Include the API key in the Authorization header of your API requests:
Configure the P0 Terraform provider with your API key:
For more information, see the P0 Terraform Provider documentation.
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
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.p0.app/o/{orgId}/...provider "p0" {
api_key = var.p0_api_key
}