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

Access requests API

Enable programmatic approval, denial, and revocation of access, enabling seamless integration with internal tools, bots, and security workflows for automated access escalation.

The Access Request API enables programmatic approval, denial, and revocation of access requests within the P0 platform. It is designed to support custom workflows and automation. Integrate with external systems and services to process access grants without using the P0 user interface.

This is particularly useful for integrating P0 into your internal tooling, bots, or security workflows that require automatic access escalation based on alerts, CI/CD pipelines, or external approvals.

Approve an access request

post

Approves a pending access request, after which P0 provisions the access. The optional body overrides the grant duration.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired

The P0 organization slug, the same value that appears in console URLs at p0.app/o/{orgId}.

requestIdstringRequired

The ID of the access request, as returned by the Command API when the request was created.

Body
expirationLengthstringOptional

A P0 duration to grant instead of the requested one, for example 30m, 2h, or 1d.

Example: 2h
isCustomExpirybooleanOptional

Set to true when expirationLength is not one of the organization's preset expiry options.

Responses
200

The request was approved.

application/json
messagestringOptionalExample: Success
post/o/{orgId}/permission-requests/{requestId}/approve
POST /o/{orgId}/permission-requests/{requestId}/approve HTTP/1.1
Host: api.p0.app
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 47

{
  "expirationLength": "2h",
  "isCustomExpiry": true
}
{
  "message": "Success"
}

Deny an access request

post

Denies a pending access request. Denial cannot be undone — the requestor must submit a new request.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired

The P0 organization slug, the same value that appears in console URLs at p0.app/o/{orgId}.

requestIdstringRequired

The ID of the access request, as returned by the Command API when the request was created.

Responses
200

The request was denied.

application/json
messagestringOptionalExample: Success
post/o/{orgId}/permission-requests/{requestId}/deny
POST /o/{orgId}/permission-requests/{requestId}/deny HTTP/1.1
Host: api.p0.app
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "message": "Success"
}

Revoke an access grant

post

Revokes an active grant before it expires. P0 automatically revokes access at expiry, so this is only needed to end a grant early. Revocation cannot be undone — the requestor must submit a new request to restore access.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
orgIdstringRequired

The P0 organization slug, the same value that appears in console URLs at p0.app/o/{orgId}.

requestIdstringRequired

The ID of the access request, as returned by the Command API when the request was created.

Responses
200

The grant was revoked.

application/json
messagestringOptionalExample: Success
post/o/{orgId}/permission-requests/{requestId}/revoke
POST /o/{orgId}/permission-requests/{requestId}/revoke HTTP/1.1
Host: api.p0.app
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "message": "Success"
}

Last updated