For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Key Management API

Create, list, and delete P0 API keys programmatically with the Management API.

The API Key Management API lets you create, list, and delete your organization's API keys programmatically. Use these endpoints to automate key provisioning and rotation in your infrastructure-as-code and CI/CD workflows.

All requests require the Owner role. Authenticate each request with an existing API key or user token by including it in the Authorization header:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.p0.app/o/{orgId}/api-key/keys

To create a key through the P0 dashboard instead, see Generating an API key.

List API keys

get

Retrieve a list of all API keys for the organization. Returns metadata only; raw keys are never exposed after creation.

Authorizations
AuthorizationstringRequired

Firebase Authentication token, API token, or P0 JWT

Path parameters
orgIdstringRequired

Organization identifier

Responses
200

API keys retrieved successfully

application/json
idstringRequired

Unique identifier for the API key

namestringRequired

Human-readable name for the API key

createdstring Β· date-timeRequired

Timestamp when the key was created

userone ofRequired

User or service account that created the key

or
get/o/{orgId}/api-key/keys

Create API key

post

Create a new API key for programmatic access. The raw API key is returned only once at creation time and should be stored securely. This action is audited as 'admin.api-key.created'.

Authorizations
AuthorizationstringRequired

Firebase Authentication token, API token, or P0 JWT

Path parameters
orgIdstringRequired

Organization identifier

Body
namestring Β· min: 1 Β· max: 100Required

Unique name for the API key (used for identification)

Responses
200

API key created successfully

application/json
idstringRequired

Unique identifier for the API key

namestringRequired

Human-readable name for the API key

createdstring Β· date-timeRequired

Timestamp when the key was created

rawApiKeystring Β· uuidRequired

The actual API key value. IMPORTANT: This is only returned once at creation time. Store it securely.

userone ofRequired

User or service account that created the key

or
post/o/{orgId}/api-key/keys

Delete API key

delete

Permanently delete an API key, immediately revoking its access. This action is audited as 'admin.api-key.deleted'.

Authorizations
AuthorizationstringRequired

Firebase Authentication token, API token, or P0 JWT

Path parameters
orgIdstringRequired

Organization identifier

keyIdstringRequired

API key identifier

Responses
200

API key deleted successfully

application/json
okbooleanOptional
delete/o/{orgId}/api-key/keys/{keyId}

Response notes

  • Create returns the plaintext key in the rawApiKey field. P0 returns it only in this response and stores only a salted hash, so you cannot retrieve it later. Copy it immediately.

  • List returns key metadata only, ordered by creation time. It never includes key material. Use each key's id to delete it.

  • Delete immediately revokes the key. Any integration still using the key can no longer authenticate, so confirm the key is unused before you delete it.

Key creation and deletion are recorded in the audit log as admin.api-key.created and admin.api-key.deleted events.

Last updated