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

Routing Rules API

Enable fine-grained control over how just-in-time access requests are evaluated, approved, and enforced—ensuring secure, compliant, and context-aware access workflows.

PreviousAccess Requests APINextCreating an Environment

Last updated 1 day ago

The Routing Rules API gives you fine-grained control over how just-in-time access requests are evaluated and approved. By defining workflow rules based on both the requestor (who is making the request) and the resource (what they’re trying to access), you can enforce consistent, auditable, and dynamic access controls across your infrastructure.

Request routing allows you to direct access requests through different approval paths based on context. For example, you can require manual approval for sensitive production systems, while allowing auto-approved access to staging environments. You can also limit request scope using filters or directory-based rules, ensuring access is only available to the right people at the right time.

⏰
🔌

Get a Routing Rule by Name

get

Retrieve a specific routing rule by its name.

Authorizations
Path parameters
orgIdstringRequired
namestringRequired
Responses
200
Routing rule returned successfully.
application/json
404
Routing rule not found
get
GET /o/{orgId}/routing/name/{name} HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Accept: */*
{
  "name": "text",
  "disabled": true,
  "requestor": {
    "type": "text",
    "uid": "text"
  },
  "resource": {
    "type": "text",
    "service": "text",
    "filters": {
      "ANY_ADDITIONAL_PROPERTY": {
        "effect": "text",
        "key": "text",
        "value": true,
        "pattern": "text"
      }
    }
  },
  "approval": [
    {
      "type": "text",
      "directory": "text",
      "integration": "text",
      "profile_property": "text",
      "services": [
        "text"
      ],
      "options": {
        "allow_one_party": true,
        "require_reason": true,
        "cooldown": 1,
        "duration": 1
      }
    }
  ]
}

Get Workflow Configuration by ID

get

Retrieve a specific routing configuration by workflow ID.

Authorizations
Path parameters
orgIdstringRequired
workflowIdstringRequired
Responses
200
Workflow configuration returned successfully.
application/json
Responseall of
404
Workflow not found
get
GET /o/{orgId}/routing/{workflowId} HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Accept: */*
{
  "id": "text",
  "createdDate": "2025-05-30T12:35:55.328Z",
  "rules": [
    {
      "name": "text",
      "disabled": true,
      "requestor": {
        "type": "text",
        "uid": "text"
      },
      "resource": {
        "type": "text",
        "service": "text",
        "filters": {
          "ANY_ADDITIONAL_PROPERTY": {
            "effect": "text",
            "key": "text",
            "value": true,
            "pattern": "text"
          }
        }
      },
      "approval": [
        {
          "type": "text",
          "directory": "text",
          "integration": "text",
          "profile_property": "text",
          "services": [
            "text"
          ],
          "options": {
            "allow_one_party": true,
            "require_reason": true,
            "cooldown": 1,
            "duration": 1
          }
        }
      ]
    }
  ]
}

Delete a Routing Rule by Name

delete

Delete the routing rule with the specified name.

Authorizations
Path parameters
orgIdstringRequired
namestringRequired
Responses
204
Routing rule deleted successfully. No content returned.
delete
DELETE /o/{orgId}/routing/name/{name} HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Accept: */*
204

Routing rule deleted successfully. No content returned.

No content

  • GETGet Routing Configuration
  • POSTSave Routing Configuration
  • GETGet a Routing Rule by Name
  • GETGet Workflow Configuration by ID
  • POSTCreate a Routing Rule by Name
  • PUTUpdate a Routing Rule by Name
  • DELETEDelete a Routing Rule by Name

Get Routing Configuration

get

Retrieve the routing configuration (WorkflowConfig) for the specified organization.

Authorizations
Path parameters
orgIdstringRequired

The ID of the organization.

Responses
200
Routing configuration returned successfully.
application/json
401
Unauthorized
403
Forbidden
get
GET /o/{orgId}/routing HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Accept: */*
{
  "id": "text",
  "createdDate": "2025-05-30T12:35:55.328Z",
  "rules": [
    {
      "name": "text",
      "disabled": true,
      "requestor": {
        "type": "text",
        "uid": "text"
      },
      "resource": {
        "type": "text",
        "service": "text",
        "filters": {
          "ANY_ADDITIONAL_PROPERTY": {
            "effect": "text",
            "key": "text",
            "value": true,
            "pattern": "text"
          }
        }
      },
      "approval": [
        {
          "type": "text",
          "directory": "text",
          "integration": "text",
          "profile_property": "text",
          "services": [
            "text"
          ],
          "options": {
            "allow_one_party": true,
            "require_reason": true,
            "cooldown": 1,
            "duration": 1
          }
        }
      ]
    }
  ]
}

Save Routing Configuration

post

Save a new version of the routing configuration.

Authorizations
Path parameters
orgIdstringRequired

The ID of the organization.

Body
currentVersionstringOptional
Responses
200
Updated routing rules returned.
application/json
post
POST /o/{orgId}/routing HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 515

{
  "currentVersion": "text",
  "workflow": {
    "id": "text",
    "createdDate": "2025-05-30T12:35:55.328Z",
    "rules": [
      {
        "name": "text",
        "disabled": true,
        "requestor": {
          "type": "text",
          "uid": "text"
        },
        "resource": {
          "type": "text",
          "service": "text",
          "filters": {
            "ANY_ADDITIONAL_PROPERTY": {
              "effect": "text",
              "key": "text",
              "value": true,
              "pattern": "text"
            }
          }
        },
        "approval": [
          {
            "type": "text",
            "directory": "text",
            "integration": "text",
            "profile_property": "text",
            "services": [
              "text"
            ],
            "options": {
              "allow_one_party": true,
              "require_reason": true,
              "cooldown": 1,
              "duration": 1
            }
          }
        ]
      }
    ]
  }
}
200

Updated routing rules returned.

{
  "rules": [
    {
      "name": "text",
      "disabled": true,
      "requestor": {
        "type": "text",
        "uid": "text"
      },
      "resource": {
        "type": "text",
        "service": "text",
        "filters": {
          "ANY_ADDITIONAL_PROPERTY": {
            "effect": "text",
            "key": "text",
            "value": true,
            "pattern": "text"
          }
        }
      },
      "approval": [
        {
          "type": "text",
          "directory": "text",
          "integration": "text",
          "profile_property": "text",
          "services": [
            "text"
          ],
          "options": {
            "allow_one_party": true,
            "require_reason": true,
            "cooldown": 1,
            "duration": 1
          }
        }
      ]
    }
  ],
  "version": "text"
}

Create a Routing Rule by Name

post

Create a new routing rule with the specified name.

Authorizations
Path parameters
orgIdstringRequired
namestringRequired
Body
namestringOptional

A human readable name for this routing rule

disabledbooleanOptional

Whether or not the routing rule should be evaluated; if false or undefined, the rule will be evaluated

Responses
200
Routing rule created successfully.
application/json
post
POST /o/{orgId}/routing/name/{name} HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 413

{
  "name": "text",
  "disabled": true,
  "requestor": {
    "type": "text",
    "uid": "text"
  },
  "resource": {
    "type": "text",
    "service": "text",
    "filters": {
      "ANY_ADDITIONAL_PROPERTY": {
        "effect": "text",
        "key": "text",
        "value": true,
        "pattern": "text"
      }
    }
  },
  "approval": [
    {
      "type": "text",
      "directory": "text",
      "integration": "text",
      "profile_property": "text",
      "services": [
        "text"
      ],
      "options": {
        "allow_one_party": true,
        "require_reason": true,
        "cooldown": 1,
        "duration": 1
      }
    }
  ]
}
200

Routing rule created successfully.

{
  "name": "text",
  "disabled": true,
  "requestor": {
    "type": "text",
    "uid": "text"
  },
  "resource": {
    "type": "text",
    "service": "text",
    "filters": {
      "ANY_ADDITIONAL_PROPERTY": {
        "effect": "text",
        "key": "text",
        "value": true,
        "pattern": "text"
      }
    }
  },
  "approval": [
    {
      "type": "text",
      "directory": "text",
      "integration": "text",
      "profile_property": "text",
      "services": [
        "text"
      ],
      "options": {
        "allow_one_party": true,
        "require_reason": true,
        "cooldown": 1,
        "duration": 1
      }
    }
  ]
}

Update a Routing Rule by Name

put

Update an existing routing rule with the specified name.

Authorizations
Path parameters
orgIdstringRequired
namestringRequired
Body
namestringOptional

A human readable name for this routing rule

disabledbooleanOptional

Whether or not the routing rule should be evaluated; if false or undefined, the rule will be evaluated

Responses
200
Routing rule updated successfully.
application/json
put
PUT /o/{orgId}/routing/name/{name} HTTP/1.1
Host: api.p0.app
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 413

{
  "name": "text",
  "disabled": true,
  "requestor": {
    "type": "text",
    "uid": "text"
  },
  "resource": {
    "type": "text",
    "service": "text",
    "filters": {
      "ANY_ADDITIONAL_PROPERTY": {
        "effect": "text",
        "key": "text",
        "value": true,
        "pattern": "text"
      }
    }
  },
  "approval": [
    {
      "type": "text",
      "directory": "text",
      "integration": "text",
      "profile_property": "text",
      "services": [
        "text"
      ],
      "options": {
        "allow_one_party": true,
        "require_reason": true,
        "cooldown": 1,
        "duration": 1
      }
    }
  ]
}
200

Routing rule updated successfully.

{
  "name": "text",
  "disabled": true,
  "requestor": {
    "type": "text",
    "uid": "text"
  },
  "resource": {
    "type": "text",
    "service": "text",
    "filters": {
      "ANY_ADDITIONAL_PROPERTY": {
        "effect": "text",
        "key": "text",
        "value": true,
        "pattern": "text"
      }
    }
  },
  "approval": [
    {
      "type": "text",
      "directory": "text",
      "integration": "text",
      "profile_property": "text",
      "services": [
        "text"
      ],
      "options": {
        "allow_one_party": true,
        "require_reason": true,
        "cooldown": 1,
        "duration": 1
      }
    }
  ]
}