Command API

Enable external systems to programmatically initiate access requests—enabling automation and integration with internal tools, bots, and security workflows.

The Command API enables programmatic creation of access requests within the P0 platform. It is designed to support custom workflows and automation. Integrate with external systems and services to initiate 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.

Submit a command to P0

post

Submits a command to P0. This endpoint allows automation of access requests or other operations.

Authorizations
Path parameters
orgIdstringRequired

Organization identifier

Body
argvstring[]Required

Command-line arguments

scriptNamestringRequired

The script or command name to execute

Example: p0
Responses
200
Command accepted and processed
application/json
post
POST /o/{orgId}/command HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 124

{
  "argv": [
    "request",
    "aws",
    "permission-set",
    "BucketList",
    "--account",
    "p0-dev",
    "--reason",
    "request via API"
  ],
  "scriptName": "p0"
}
{
  "ok": true,
  "message": "text",
  "id": "text",
  "isPreexisting": true,
  "isPersistent": true
}

Last updated