P0 App Documentation
Sign up for FreeKnowledge Base
  • What Is P0?
    • 🎛️IAM Dashboard
    • 🔎Access Inventory
    • 🪑IAM Posture
    • ⏱️Just-In-Time Access
    • ♻️Service-Account Key Rotation
  • Getting Started
    • ⬇️Quick Start
    • 🎁Share P0 With Your Team
  • INVENTORY
    • 🗺️Access Inventory
    • 🔬Result Details
    • ❔Query Search
      • 📖Search Reference
  • Posture
    • ⚖️Posture Overview
  • Monitor Results
  • 🤔Finding Details
  • ORCHESTRATION
    • ⏰Just-in-time access
      • 🖐️Requesting Access
        • 👉For Another Party
      • 🏁Approving Access
        • Pre-approving Access
      • 🔀Request Routing
        • Google Cloud Filtering
        • AWS Filtering
      • 🗒️Session Recording
        • 📦AWS
      • 🔌Just-in-time API
        • Command API
        • Access Requests API
        • Routing Rules API
  • Environments
    • ☁️Creating an Environment
    • 📓Environment Terminology
    • ⚙️Settings
  • Integrations
    • 📞Notifier integrations
      • 💬Slack
      • 👬Microsoft Teams
      • 📣Custom Notifiers
        • AWS Lambda Notifier
    • 🔑Resource integrations
      • ☁️Google Cloud
        • Security Perimeter
        • Requesting Access
        • Permissions Reference
          • Cloud Storage
          • Compute Engine
        • Function Caller
      • 📦AWS
        • Requesting Access
        • AWS Integration API
        • Function Caller
      • ☸️Kubernetes
        • Requesting Access
        • Advanced Requests
      • 🔋PostgreSQL
        • Requesting Access
      • ❄️Snowflake
      • 🖥️SSH
      • GitHub
        • Requesting Access
      • 🛠️Custom Resource
        • Installing a Custom Resource Integration
    • 👥Directory integrations
      • Microsoft Entra ID
        • Requesting Access
      • Google Workspace
      • Okta
    • ✔️Approval integrations
      • 🔔PagerDuty
    • ⚡SIEM Integrations
      • Splunk HEC Setup
  • 📝Tracker integrations
    • 🎟️Jira
  • P0 Management
    • 🎩Role-Based Access Control
    • 🔌Management API
      • Role Management API
      • Just-in-time settings API
Powered by GitBook
On this page
  1. ORCHESTRATION
  2. Just-in-time access
  3. Just-in-time API

Command API

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

PreviousJust-in-time APINextAccess Requests API

Last updated 1 day ago

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
400
Bad request – malformed payload
401
Unauthorized – missing or invalid token
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
}