P4A Documentation
APIs

REST API reference

The non-admin P4A REST API surface — endpoints, scopes, request and response shapes, reachable with a personal access token.

Overview

This is the interactive reference for the P4A REST API — every endpoint an external client or script can call with a personal access token. Each operation below lists its method, path, required scope, request body, and response shape, with an interactive playground for trying calls.

The same endpoints power the dashboard and the hosted MCP server, so the MCP catalog tools are thin wrappers over the policy endpoints documented here.

Policy Ideas are not part of the token-scoped REST surface — read and act on them through the MCP idea tools (list_ideas, get_idea, submit_idea, vote_idea) instead. Idea delivery still shows up here from the policy side: GET /api/policies/{id} returns delivers_ideas (the ideas a policy delivers, with coverage), and POST /api/submissions accepts deliversIdeaIds to declare delivery when submitting.

Authentication

Send your token as a Bearer credential on every request:

curl https://www.p4a.ai/api/policies \
  -H "Authorization: Bearer p4a_xxxxxxxxxxxxxxxxxxxxxxxx"

A token acts as you: requests are attributed to your account and scoped to what you can already access. See Personal access tokens to create and manage tokens.

Scopes

Each endpoint requires one scope, chosen by HTTP method:

  • api:read — GET requests.
  • api:write — POST, PATCH, PUT, DELETE requests.

A request whose token lacks the required scope is rejected with 403; a missing, invalid, expired, or revoked token is rejected with 401.

Download the spec

The full OpenAPI 3.1 spec is available for import into Postman, Insomnia, or a code generator:

Policies

GET/api/policies

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Query Parameters

category?string

Filter by policy category.

q?string

Free-text search over name and description (name and summary for source=mulesoft).

source?string

Which catalog to list. community (default) = user-submitted P4A policies. mulesoft = MuleSoft out-of-the-box Omni/Flex Gateway policies (read-only, MuleSoftPolicySummary items).

Default"community"
Value in"community""mulesoft"
direction?string

Filter by enforcement leg — inbound (incoming request, most policies) or outbound (upstream/response leg). Applies to both community and mulesoft sources.

Value in"inbound""outbound"
assetKind?string

source=community only. Filter by asset type — policies that target the specified kind (agent, api, llm, or mcp). Ignored for the MuleSoft catalog.

Value in"agent""api""llm""mcp"
sort?string

Sort key. alpha (default) orders by policy name; submitted orders by submission date (community catalog only). For source=mulesoft only alpha applies — the batch-synced MuleSoft catalog has no meaningful submission date, so submitted falls back to alpha. Unrecognized values fall back to alpha.

Default"alpha"
Value in"alpha""submitted"
order?string

Sort direction. Defaults to asc for sort=alpha and desc for sort=submitted. Unrecognized values fall back to the per-key default.

Value in"asc""desc"

Response Body

The matching policies.

application/json
  1. response
policies?array<|>

Policy items for the community catalog; MuleSoftPolicySummary items when source=mulesoft.

curl -X GET 'https://www.p4a.ai/api/policies'
{  "policies": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "slug": "string",      "name": "string",      "description": "string",      "category": "string",      "status": "string",      "liked": true,      "github_has_issues": true,      "delivers_ideas": [        {          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",          "title": "string",          "phase": "declared",          "coverage": "full",          "scope_note": "string",          "completes_idea": true        }      ],      "contributors": [        {          "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",          "username": "string",          "name": "string"        }      ],      "owner_avatar_url": "string",      "owner_avatar_email_hash": "string",      "docs_summary": {        "tabCount": 0,        "completeness": {          "filled": 0,          "total": 0,          "ratio": 0        }      },      "asset_kinds": [        "agent"      ],      "a2a_protocol_versions": [        "v0.3.0"      ],      "direction": "inbound",      "source_ref": "string",      "implementation_source_ref": "string"    }  ]}
GET/api/policies/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The policy.

application/json
  1. response
policy?
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "policy": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "slug": "string",    "name": "string",    "description": "string",    "category": "string",    "status": "string",    "liked": true,    "github_has_issues": true,    "delivers_ideas": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "title": "string",        "phase": "declared",        "coverage": "full",        "scope_note": "string",        "completes_idea": true      }    ],    "contributors": [      {        "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",        "username": "string",        "name": "string"      }    ],    "owner_avatar_url": "string",    "owner_avatar_email_hash": "string",    "docs_summary": {      "tabCount": 0,      "completeness": {        "filled": 0,        "total": 0,        "ratio": 0      }    },    "asset_kinds": [      "agent"    ],    "a2a_protocol_versions": [      "v0.3.0"    ],    "direction": "inbound",    "source_ref": "string",    "implementation_source_ref": "string"  }}
PATCH/api/policies/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
name?string
description?string
category?string
videoTutorialUrl?string
examplesUrl?string
githubUrl?string

GitHub, GitLab, or Bitbucket repo URL of the policy definition.

Formaturi
implementationGithubUrl?string

Split-model only: GitHub, GitLab, or Bitbucket repo URL of the implementation root.

sourceRef?string

Default git branch/tag/commit used when this policy is deployed (#1033). Send an empty string to clear it back to the repository's default branch. Admin-only.

implementationSourceRef?string

Split-model only: default git ref for the implementation root (#1033). Empty string clears it. Admin-only.

iconUrl?string
iconDisabled?boolean

Response Body

The updated policy.

application/json
  1. response
policy?
curl -X PATCH 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "policy": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "slug": "string",    "name": "string",    "description": "string",    "category": "string",    "status": "string",    "liked": true,    "github_has_issues": true,    "delivers_ideas": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "title": "string",        "phase": "declared",        "coverage": "full",        "scope_note": "string",        "completes_idea": true      }    ],    "contributors": [      {        "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",        "username": "string",        "name": "string"      }    ],    "owner_avatar_url": "string",    "owner_avatar_email_hash": "string",    "docs_summary": {      "tabCount": 0,      "completeness": {        "filled": 0,        "total": 0,        "ratio": 0      }    },    "asset_kinds": [      "agent"    ],    "a2a_protocol_versions": [      "v0.3.0"    ],    "direction": "inbound",    "source_ref": "string",    "implementation_source_ref": "string"  }}
GET/api/policies/{id}/branches

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Branch information for the policy's source repository.

application/json
  1. response
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/branches'
{}
POST/api/policies/{id}/download

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X POST 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/download'
{  "ok": true}
GET/api/policies/{id}/history

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Query Parameters

limit?integer
before?string

Response Body

History entries, newest first.

application/json
  1. response
entries?array<>
nextCursor?string|null
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/history'
{  "entries": [    {}  ],  "nextCursor": "string"}
GET/api/policies/{id}/issues-enabled

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The live issue-tracker state. enabled is null when the provider couldn't be read (private/gone repo, rate limit, network) — the caller should keep trusting the persisted github_has_issues.

application/json
  1. response
enabled?boolean
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/issues-enabled'
{  "enabled": true}
GET/api/policies/{id}/like

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Your like state.

application/json
  1. response
liked?boolean
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/like'
{  "liked": true}
POST/api/policies/{id}/like

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Your like state after toggling.

application/json
  1. response
liked?boolean
curl -X POST 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/like'
{  "liked": true}
GET/api/policies/{id}/orgs

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Query Parameters

connectionId*string
Formatuuid

Response Body

The eligible organizations for the given connection.

application/json
  1. response
orgs?array<>
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/orgs?connectionId=497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "orgs": [    {      "id": "string",      "name": "string",      "isPrimary": true,      "fullPath": "string"    }  ]}
GET/api/policies/{id}/reviewers/me

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Your reviewer state.

application/json
  1. response
isReviewer?boolean
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/reviewers/me'
{  "isReviewer": true}
GET/api/policies/{id}/revisions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Your revisions for this policy, newest first.

application/json
  1. response
revisions?array<>
curl -X GET 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/revisions'
{  "revisions": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "policy_id": "ee9b03e0-6495-427a-85a5-34444d24ae04",      "field": "description",      "proposed_value": "string",      "previous_value": "string",      "status": "pending",      "feedback": "string",      "submitted_at": "2019-08-24T14:15:22Z",      "reviewed_at": "2019-08-24T14:15:22Z"    }  ]}
POST/api/policies/{id}/revisions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
field*"description"
Value in"description"
value*string

New Markdown About text.

Length10 <= length <= 20000

Response Body

The created pending revision.

application/json
  1. response
revision?

An owner-proposed edit to a single published-policy field, pending an administrator's re-review before it goes live.

policy_name?string
curl -X POST 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/revisions' \  -H 'Content-Type: application/json' \  -d '{  "field": "description",  "value": "stringstri"}'
{  "revision": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "policy_id": "ee9b03e0-6495-427a-85a5-34444d24ae04",    "field": "description",    "proposed_value": "string",    "previous_value": "string",    "status": "pending",    "feedback": "string",    "submitted_at": "2019-08-24T14:15:22Z",    "reviewed_at": "2019-08-24T14:15:22Z"  },  "policy_name": "string"}

Submissions

GET/api/submissions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Response Body

Your submissions.

application/json
  1. response
submissions?array<>
curl -X GET 'https://www.p4a.ai/api/submissions'
{  "submissions": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "description": "string",      "status": "string",      "githubUrl": "http://example.com",      "feedback": "string"    }  ]}
POST/api/submissions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
projectType?string
Value in"unified""split"
name*string
Length2 <= length <= 120
description*string
Length10 <= length <= 20000
githubUrl*string

GitHub, GitLab, or Bitbucket repo URL, e.g. https://github.com/owner/repo, https://gitlab.com/owner/repo, or https://bitbucket.org/workspace/repo.

Formaturi
implementationGithubUrl?string

Required when projectType is split. Same GitHub/GitLab/Bitbucket URL shapes.

Formaturi
sourceRef?string

Optional default git branch, tag, or commit (#1033), used as the default source ref when this policy is deployed. Omit to use the repository's default branch. Deployers can still choose another ref.

Length1 <= length <= 255
implementationSourceRef?string

Split-model only: optional default git ref for the implementation root (#1033). Omit to use the repository's default branch.

Length1 <= length <= 255
category?string
videoTutorialUrl?string
examplesUrl?string
iconUrl?string
iconDisabled?boolean
deliversIdeaId?string

Legacy single-idea form (still accepted). Prefer deliversIdeaIds. The id of an approved Policy Idea this submission delivers.

Formatuuid
deliversIdeaIds?array<>

Optional. Approved Policy Ideas this submission declares it delivers, each with a coverage. Every referenced idea must be approved and visible to you, or the request is rejected (422). This records the declared intent while the policy is under review; each idea flips to delivered (and its submitter is notified) only once a policy that fully delivers it — or that an admin marks as completing it — is approved and published. An idea may be delivered by more than one policy, and a policy may deliver more than one idea.

Itemsitems <= 50
assetKinds?array<>

Optional. Asset types this policy targets. Defaults to values inferred from the repository's gcl.yaml metadata or name/description keywords.

a2aProtocolVersions?array<>

Optional. A2A protocol versions this policy supports, only meaningful when 'agent' is present in assetKinds.

docTabs?array<>

Optional. Rich, tabbed documentation staged with the submission and shown on the published policy page. Tabs with the reserved keys overview, configuration, examples, and faq are treated as predefined; any other key is a custom tab. Do not send an overview tab — the overview is seeded from description on review, and an empty overview here would clobber it. Tabs with an empty body are ignored.

Itemsitems <= 50

Response Body

The created submission and repository validation result.

application/json
  1. response
submission?
validation?
curl -X POST 'https://www.p4a.ai/api/submissions' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "description": "stringstri",  "githubUrl": "http://example.com"}'
{  "submission": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "description": "string",    "status": "string",    "githubUrl": "http://example.com",    "feedback": "string"  },  "validation": {}}
GET/api/submissions/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The submission and its staged documentation tabs.

application/json
  1. response
submission?
docTabs?array<>
curl -X GET 'https://www.p4a.ai/api/submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "submission": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "description": "string",    "status": "string",    "githubUrl": "http://example.com",    "feedback": "string"  },  "docTabs": [    {      "key": "string",      "title": "string",      "kind": "predefined",      "bodyMd": "string",      "sortOrder": 0    }  ]}
PATCH/api/submissions/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body

Response Body

The updated submission.

application/json
  1. response
submission?
curl -X PATCH 'https://www.p4a.ai/api/submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "submission": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "description": "string",    "status": "string",    "githubUrl": "http://example.com",    "feedback": "string"  }}
GET/api/submissions/{id}/history

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Review history entries.

application/json
  1. response
entries?array<>
curl -X GET 'https://www.p4a.ai/api/submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08/history'
{  "entries": [    {}  ]}
POST/api/submissions/validate

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
projectType?string
Value in"unified""split"
githubUrl?string

GitHub, GitLab, or Bitbucket repo URL, e.g. https://github.com/owner/repo, https://gitlab.com/owner/repo, or https://bitbucket.org/workspace/repo.

Formaturi
implementationGithubUrl?string

Required when projectType is split. Same GitHub/GitLab/Bitbucket URL shapes.

Formaturi

Response Body

The validation result.

application/json
  1. response
validation?
curl -X POST 'https://www.p4a.ai/api/submissions/validate' \  -H 'Content-Type: application/json' \  -d '{}'
{  "validation": {}}

Rulesets

Community governance rulesets: browse the catalog, submit a ruleset repository for review, and track your submissions.

GET/api/rulesets

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Query Parameters

source?string

Which catalog to list. community (default) = user-submitted rulesets (RulesetSummary items). mulesoft = MuleSoft out-of-the-box rulesets (read-only, MulesoftRulesetSummary items).

Default"community"
Value in"community""mulesoft"
q?string

Free-text search over name and description (also for source=mulesoft).

Lengthlength <= 200
category?string

Filter by category: one of the RulesetCategory values, or All Categories for no filter. For source=mulesoft it matches one of the ruleset's Exchange categories exactly (most MuleSoft rulesets have none).

Lengthlength <= 120
scope?string

Only rulesets that target this API type. agent-network is a deprecated alias for agent.

Value in"rest-api""async-api""http-api""grpc-api""agent""mcp""agent-network"
sort?string

Sort key. alpha sorts by name; submitted by submission time; likes and views by engagement. Unrecognized values fall back to alpha. For source=mulesoft only alpha applies, because the batch-synced catalog has no submission date or engagement counters; the other keys fall back to alpha.

Default"alpha"
Value in"alpha""submitted""likes""views"
order?string

Sort direction. Defaults to asc for alpha and desc for the others.

Value in"asc""desc"
limit?integer
Range1 <= value <= 200
Default100
offset?integer
Range0 <= value
Default0

Response Body

One page of rulesets.

application/json
  1. response
rulesets?array<|>

RulesetSummary items for the community catalog; MulesoftRulesetSummary items when source=mulesoft. Tell them apart by source.

hasMore?boolean
curl -X GET 'https://www.p4a.ai/api/rulesets'
{  "rulesets": [    {      "source": "community",      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "description": "string",      "category": "Security",      "profile_name": "string",      "rule_counts": {        "violation": 0,        "warning": 0,        "info": 0      },      "target_scopes": [        "rest-api"      ],      "tags": [        "string"      ],      "icon_url": "http://example.com",      "exchange_asset_id": "string",      "lifecycle_status": "under_review",      "published_at": "2019-08-24T14:15:22Z",      "likes": 0,      "views": 0,      "deploys": 0,      "comment_count": 0,      "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",      "owner_name": "string",      "owner_username": "string",      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ],  "hasMore": true}
GET/api/rulesets/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The ruleset.

application/json
  1. response
ruleset?
curl -X GET 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "ruleset": {    "source": "community",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "description": "string",    "category": "Security",    "profile_name": "string",    "rule_counts": {      "violation": 0,      "warning": 0,      "info": 0    },    "target_scopes": [      "rest-api"    ],    "tags": [      "string"    ],    "icon_url": "http://example.com",    "exchange_asset_id": "string",    "lifecycle_status": "under_review",    "published_at": "2019-08-24T14:15:22Z",    "likes": 0,    "views": 0,    "deploys": 0,    "comment_count": 0,    "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",    "owner_name": "string",    "owner_username": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "submission_id": "945dfedc-ad7f-4af7-b20c-06082ffa3cb3",    "source_url": "http://example.com",    "source_ref": "string",    "ruleset_path": "string",    "rule_names": [      "string"    ],    "video_tutorial_url": "http://example.com",    "examples_url": "http://example.com",    "review_feedback": "string",    "reviewed_at": "2019-08-24T14:15:22Z",    "contributors": [      {        "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",        "username": "string",        "name": "string"      }    ],    "delivers_ideas": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "slug": "string",        "title": "string",        "phase": "declared",        "coverage": "full",        "scope_note": "string",        "completes_idea": true      }    ]  }}
PATCH/api/rulesets/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body

As the owner you can set these two links. Send an empty string to clear one.

Properties1 <= properties
videoTutorialUrl?string
examplesUrl?string

Response Body

The updated ruleset.

application/json
  1. response
ruleset?
curl -X PATCH 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "ruleset": {    "source": "community",    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "description": "string",    "category": "Security",    "profile_name": "string",    "rule_counts": {      "violation": 0,      "warning": 0,      "info": 0    },    "target_scopes": [      "rest-api"    ],    "tags": [      "string"    ],    "icon_url": "http://example.com",    "exchange_asset_id": "string",    "lifecycle_status": "under_review",    "published_at": "2019-08-24T14:15:22Z",    "likes": 0,    "views": 0,    "deploys": 0,    "comment_count": 0,    "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",    "owner_name": "string",    "owner_username": "string",    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "submission_id": "945dfedc-ad7f-4af7-b20c-06082ffa3cb3",    "source_url": "http://example.com",    "source_ref": "string",    "ruleset_path": "string",    "rule_names": [      "string"    ],    "video_tutorial_url": "http://example.com",    "examples_url": "http://example.com",    "review_feedback": "string",    "reviewed_at": "2019-08-24T14:15:22Z",    "contributors": [      {        "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",        "username": "string",        "name": "string"      }    ],    "delivers_ideas": [      {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "slug": "string",        "title": "string",        "phase": "declared",        "coverage": "full",        "scope_note": "string",        "completes_idea": true      }    ]  }}
GET/api/rulesets/{id}/reviewers/me

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Your reviewer state.

application/json
  1. response
isReviewer*boolean
role*|
Value in"viewer""commenter""editor"null
curl -X GET 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08/reviewers/me'
{  "isReviewer": true,  "role": "viewer"}
GET/api/rulesets/{id}/docs

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The documentation tabs and completeness.

application/json
  1. response

A ruleset's documentation tabs as the caller sees them (#1163).

tabs?array<>

Tabs ordered by sortOrder. Callers who can't edit get only the overview and the tabs with content.

completeness?

How many of the predefined documentation tabs carry non-empty content. A soft signal for badges / progress UI, not a gate. Only the four predefined tabs (overview/configuration/examples/faq) count.

canEdit?boolean

Whether the caller may edit these tabs.

curl -X GET 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08/docs'
{  "tabs": [    {      "key": "string",      "title": "string",      "kind": "predefined",      "bodyMd": "string",      "sortOrder": 0    }  ],  "completeness": {    "filled": 0,    "total": 0,    "ratio": 0  },  "canEdit": true}
POST/api/rulesets/{id}/docs

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body

The complete new tab set for a ruleset. Must include an overview tab (the one mandatory tab). Keys overview/rules/examples/faq become predefined tabs; others (including configuration) are custom.

tabs*array<>
Items1 <= items <= 50

Response Body

The new documentation tab set and completeness.

application/json
  1. response

A ruleset's documentation tabs as the caller sees them (#1163).

tabs?array<>

Tabs ordered by sortOrder. Callers who can't edit get only the overview and the tabs with content.

completeness?

How many of the predefined documentation tabs carry non-empty content. A soft signal for badges / progress UI, not a gate. Only the four predefined tabs (overview/configuration/examples/faq) count.

canEdit?boolean

Whether the caller may edit these tabs.

curl -X POST 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08/docs' \  -H 'Content-Type: application/json' \  -d '{  "tabs": [    {      "key": "string",      "title": "string"    }  ]}'
{  "tabs": [    {      "key": "string",      "title": "string",      "kind": "predefined",      "bodyMd": "string",      "sortOrder": 0    }  ],  "completeness": {    "filled": 0,    "total": 0,    "ratio": 0  },  "canEdit": true}
PUT/api/rulesets/{id}/docs/{key}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid
key*string

Tab key. overview/rules/examples/faq are predefined tabs; any other key (including configuration) is a custom tab.

Match^[a-z0-9][a-z0-9_-]{0,63}$

Request Body

application/json
  1. body
title*string
bodyMd?string
sortOrder?integer

Response Body

The tab as stored.

application/json
  1. response
tab?

One per-policy documentation tab (#817).

curl -X PUT 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08/docs/string' \  -H 'Content-Type: application/json' \  -d '{  "title": "string"}'
{  "tab": {    "key": "string",    "title": "string",    "kind": "predefined",    "bodyMd": "string",    "sortOrder": 0  }}
DELETE/api/rulesets/{id}/docs/{key}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid
key*string

Tab key. overview/rules/examples/faq are predefined tabs; any other key (including configuration) is a custom tab.

Match^[a-z0-9][a-z0-9_-]{0,63}$

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X DELETE 'https://www.p4a.ai/api/rulesets/497f6eca-6276-4993-bfeb-53cbbbba6f08/docs/string'
{  "ok": true}
GET/api/ruleset-submissions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Response Body

Your ruleset submissions.

application/json
  1. response
submissions?array<>
curl -X GET 'https://www.p4a.ai/api/ruleset-submissions'
{  "submissions": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "status": "submitted",      "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",      "name": "string",      "description": "string",      "category": "Security",      "source_url": "http://example.com",      "source_ref": "string",      "ruleset_path": "string",      "profile_name": "string",      "rule_counts": {        "violation": 0,        "warning": 0,        "info": 0      },      "rule_names": [        "string"      ],      "target_scopes": [        "rest-api"      ],      "exchange_asset_id": "string",      "icon_url": "http://example.com",      "tags": [        "string"      ],      "video_tutorial_url": "http://example.com",      "examples_url": "http://example.com",      "review_feedback": "string",      "reviewed_by": "92ab4dbc-1b27-40ce-b24b-7dde8f4709be",      "reviewed_at": "2019-08-24T14:15:22Z",      "ruleset_id": "ca688a19-2766-4b2c-aefa-28d16a464773",      "previous_snapshot": {        "name": "string",        "description": "string",        "category": "Security",        "source_url": "http://example.com",        "source_ref": "string",        "ruleset_path": "string",        "profile_name": "string",        "rule_names": [          "string"        ],        "target_scopes": [          "rest-api"        ],        "exchange_asset_id": "string",        "tags": [          "string"        ],        "video_tutorial_url": "http://example.com",        "examples_url": "http://example.com",        "snapshotted_at": "2019-08-24T14:15:22Z"      },      "revision_count": 0,      "created_at": "2019-08-24T14:15:22Z",      "updated_at": "2019-08-24T14:15:22Z"    }  ]}
POST/api/ruleset-submissions

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
name*string
Length2 <= length <= 120
description*string
Length10 <= length <= 20000
repoUrl*string

Public GitHub, GitLab, or Bitbucket repo URL. A /tree/<ref>/<path> URL scopes the ruleset root to that folder.

Formaturi
category?RulesetCategory

Catalog category of a community ruleset. Defaults to Other.

Value in"Security""API Design""Documentation""Compliance""MCP""A2A""LLM""Operations""Other"
sourceRef?string

Default branch, tag, or commit. Omit (or send an empty string) for the default branch.

Lengthlength <= 255
rulesetPath?string

Profile file path relative to the ruleset root. Omit to auto-discover it.

Lengthlength <= 1024
targetScopes?array<>

Asset kinds the ruleset applies to. Defaults to what the profile targets.

exchangeAssetId?string
Match^[A-Za-z0-9][A-Za-z0-9._-]*$
Lengthlength <= 255
iconUrl?string

Catalog icon. Omit to use icon.png or icon.svg from the ruleset root, if present.

Formaturi
iconDisabled?boolean

Show the default icon, ignoring iconUrl and any icon in the repository.

tags?array<>
Itemsitems <= 20
videoTutorialUrl?string
Formaturi
examplesUrl?string
Formaturi
docTabs?array<>

Optional documentation tabs (#1163), staged with the submission and copied to the ruleset when it moves to review. Keys must be unique. The reserved keys overview, rules, examples and faq are predefined tabs; any other key is a custom tab. Missing predefined tabs are added empty, and a blank overview keeps the description as the overview.

Itemsitems <= 50
deliversIdeaIds?array<>

Optional. Approved ideas this submission declares it delivers, each with a coverage. Every idea must be approved and visible to you, and may appear once, or the request is rejected (422). This is declared intent: an idea flips to delivered (and its submitter is notified) only once a ruleset that fully delivers it, or that an admin marks as completing it, is approved.

Itemsitems <= 50

Response Body

The created submission and any validation warnings.

application/json
  1. response
submission?
warnings?array<string>
curl -X POST 'https://www.p4a.ai/api/ruleset-submissions' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "description": "stringstri",  "repoUrl": "http://example.com"}'
{  "submission": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "submitted",    "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",    "name": "string",    "description": "string",    "category": "Security",    "source_url": "http://example.com",    "source_ref": "string",    "ruleset_path": "string",    "profile_name": "string",    "rule_counts": {      "violation": 0,      "warning": 0,      "info": 0    },    "rule_names": [      "string"    ],    "target_scopes": [      "rest-api"    ],    "exchange_asset_id": "string",    "icon_url": "http://example.com",    "tags": [      "string"    ],    "video_tutorial_url": "http://example.com",    "examples_url": "http://example.com",    "review_feedback": "string",    "reviewed_by": "92ab4dbc-1b27-40ce-b24b-7dde8f4709be",    "reviewed_at": "2019-08-24T14:15:22Z",    "ruleset_id": "ca688a19-2766-4b2c-aefa-28d16a464773",    "previous_snapshot": {      "name": "string",      "description": "string",      "category": "Security",      "source_url": "http://example.com",      "source_ref": "string",      "ruleset_path": "string",      "profile_name": "string",      "rule_names": [        "string"      ],      "target_scopes": [        "rest-api"      ],      "exchange_asset_id": "string",      "tags": [        "string"      ],      "video_tutorial_url": "http://example.com",      "examples_url": "http://example.com",      "snapshotted_at": "2019-08-24T14:15:22Z"    },    "revision_count": 0,    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  },  "warnings": [    "string"  ]}
GET/api/ruleset-submissions/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The submission.

application/json
  1. response
submission?
docTabs?array<>

The documentation tabs staged on the submission (#1163), copied to the ruleset when it moves to review.

curl -X GET 'https://www.p4a.ai/api/ruleset-submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "submission": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "submitted",    "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",    "name": "string",    "description": "string",    "category": "Security",    "source_url": "http://example.com",    "source_ref": "string",    "ruleset_path": "string",    "profile_name": "string",    "rule_counts": {      "violation": 0,      "warning": 0,      "info": 0    },    "rule_names": [      "string"    ],    "target_scopes": [      "rest-api"    ],    "exchange_asset_id": "string",    "icon_url": "http://example.com",    "tags": [      "string"    ],    "video_tutorial_url": "http://example.com",    "examples_url": "http://example.com",    "review_feedback": "string",    "reviewed_by": "92ab4dbc-1b27-40ce-b24b-7dde8f4709be",    "reviewed_at": "2019-08-24T14:15:22Z",    "ruleset_id": "ca688a19-2766-4b2c-aefa-28d16a464773",    "previous_snapshot": {      "name": "string",      "description": "string",      "category": "Security",      "source_url": "http://example.com",      "source_ref": "string",      "ruleset_path": "string",      "profile_name": "string",      "rule_names": [        "string"      ],      "target_scopes": [        "rest-api"      ],      "exchange_asset_id": "string",      "tags": [        "string"      ],      "video_tutorial_url": "http://example.com",      "examples_url": "http://example.com",      "snapshotted_at": "2019-08-24T14:15:22Z"    },    "revision_count": 0,    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  },  "docTabs": [    {      "key": "string",      "title": "string",      "kind": "predefined",      "bodyMd": "string",      "sortOrder": 0    }  ]}
PATCH/api/ruleset-submissions/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body

Any subset of the RulesetSubmissionInput fields. An empty string clears an optional field.

Properties1 <= properties
name?string
Length2 <= length <= 120
description?string
Length10 <= length <= 20000
repoUrl?string
Formaturi
category?RulesetCategory

Catalog category of a community ruleset. Defaults to Other.

Value in"Security""API Design""Documentation""Compliance""MCP""A2A""LLM""Operations""Other"
sourceRef?string
Lengthlength <= 255
rulesetPath?string
Lengthlength <= 1024
targetScopes?array<>
exchangeAssetId?string
Lengthlength <= 255
iconUrl?string
iconDisabled?boolean

Clear the icon and show the default. Wins over iconUrl.

tags?array<string>
videoTutorialUrl?string
examplesUrl?string
resubmit?boolean

Send a needs_improvement submission back for review.

docTabs?array<>

Optional documentation tabs (#1163), staged with the submission and copied to the ruleset when it moves to review. Keys must be unique. The reserved keys overview, rules, examples and faq are predefined tabs; any other key is a custom tab. Missing predefined tabs are added empty, and a blank overview keeps the description as the overview. On a patch the array replaces the staged set; omit it to keep the staged tabs.

Itemsitems <= 50
deliversIdeaIds?array<>

Replaces the ideas this submission declares it delivers. Omit it to keep them; send [] to clear them. Every idea you add must be approved and visible to you (422); ideas already declared stay valid even if they have since been delivered. You can change them while the submission is submitted or needs_improvement; sending only this field does not resubmit. Once the ruleset is under review only an admin can change them (403). When the same request also edits fields or resubmits, the edit is applied first, and if it is rejected (409/403) the declared ideas are left unchanged.

Itemsitems <= 50

Response Body

The updated submission.

application/json
  1. response
submission?
curl -X PATCH 'https://www.p4a.ai/api/ruleset-submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "submission": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "status": "submitted",    "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",    "name": "string",    "description": "string",    "category": "Security",    "source_url": "http://example.com",    "source_ref": "string",    "ruleset_path": "string",    "profile_name": "string",    "rule_counts": {      "violation": 0,      "warning": 0,      "info": 0    },    "rule_names": [      "string"    ],    "target_scopes": [      "rest-api"    ],    "exchange_asset_id": "string",    "icon_url": "http://example.com",    "tags": [      "string"    ],    "video_tutorial_url": "http://example.com",    "examples_url": "http://example.com",    "review_feedback": "string",    "reviewed_by": "92ab4dbc-1b27-40ce-b24b-7dde8f4709be",    "reviewed_at": "2019-08-24T14:15:22Z",    "ruleset_id": "ca688a19-2766-4b2c-aefa-28d16a464773",    "previous_snapshot": {      "name": "string",      "description": "string",      "category": "Security",      "source_url": "http://example.com",      "source_ref": "string",      "ruleset_path": "string",      "profile_name": "string",      "rule_names": [        "string"      ],      "target_scopes": [        "rest-api"      ],      "exchange_asset_id": "string",      "tags": [        "string"      ],      "video_tutorial_url": "http://example.com",      "examples_url": "http://example.com",      "snapshotted_at": "2019-08-24T14:15:22Z"    },    "revision_count": 0,    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z"  }}
DELETE/api/ruleset-submissions/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X DELETE 'https://www.p4a.ai/api/ruleset-submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "ok": true}
GET/api/ruleset-submissions/{id}/history

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Review history entries.

application/json
  1. response
entries?array<>
curl -X GET 'https://www.p4a.ai/api/ruleset-submissions/497f6eca-6276-4993-bfeb-53cbbbba6f08/history'
{  "entries": [    {}  ]}
POST/api/ruleset-submissions/validate

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
repoUrl*string

GitHub, GitLab, or Bitbucket repo URL. A /tree/<ref>/<path> URL scopes the ruleset root to that folder.

Formaturi
ref?string

Branch, tag, or commit to inspect. Defaults to the URL ref, then the default branch.

rulesetPath?string

Profile file path relative to the ruleset root; skips auto-discovery.

includeBranches?boolean

Also return the repository's branch list for a ref picker.

Response Body

The validation result. validation.ok is false (with errors) when the repository or profile is not acceptable.

application/json
  1. response
validation?
branchInfo?

Present when includeBranches is true and validation passed.

curl -X POST 'https://www.p4a.ai/api/ruleset-submissions/validate' \  -H 'Content-Type: application/json' \  -d '{  "repoUrl": "http://example.com"}'
{  "validation": {    "ok": true,    "errors": [      "string"    ],    "warnings": [      "string"    ],    "ref": "string",    "subPath": "string",    "rulesetPath": "string",    "rulesetPathSource": "explicit",    "profile": {      "profileName": "string",      "description": "string",      "ruleNames": [        "string"      ],      "ruleCounts": {        "violation": 0,        "warning": 0,        "info": 0      },      "targetClasses": [        "string"      ],      "dialectVersion": "1.0"    },    "exchange": {      "assetId": "string",      "name": "string",      "description": "string",      "main": "string"    },    "targetScopes": [      "rest-api"    ],    "iconUrl": "http://example.com"  },  "branchInfo": {}}

Deployments

GET/api/deployments

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Query Parameters

rulesetId?string

Only ruleset deployments for this ruleset.

Formatuuid
assetType?string

Filter by deployed asset type. Omit to return both.

Value in"policy""ruleset"

Response Body

Your deployments, paginated.

application/json
  1. response
deployments?array<>
pagination?
curl -X GET 'https://www.p4a.ai/api/deployments'
{  "deployments": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "asset_type": "policy",      "policy_id": "ee9b03e0-6495-427a-85a5-34444d24ae04",      "ruleset_id": "ca688a19-2766-4b2c-aefa-28d16a464773",      "governance_profile": {},      "governance_profile_result": {},      "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9",      "workspace_id": "0967198e-ec7b-4c6b-b4d3-f71244cadbe9",      "status": "string",      "anypoint_org_id": "string",      "definition_asset_version": "string",      "implementation_asset_version": "string",      "home_doc_status": "published"    }  ],  "pagination": {}}
POST/api/deployments

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
policyId*string
Formatuuid
connectionId*string
Formatuuid
workspaceId*string
Formatuuid
targetOrganizationIds*array<string>
Items1 <= items <= 50
doPublish?boolean
doRelease?boolean
cleanupDev?boolean
ref?string
implementationRef?string
version?string

Optional override for the published Exchange asset version. Semver core only (MAJOR.MINOR.PATCH, e.g. 1.2.3 — no v prefix, no pre-release/build suffix). Omit to derive the version from the policy repo. A Publish still appends a -dev.<timestamp> suffix.

Match^\d+\.\d+\.\d+$

Response Body

All target organizations were enqueued successfully.

application/json
  1. response
results?array<>
curl -X POST 'https://www.p4a.ai/api/deployments' \  -H 'Content-Type: application/json' \  -d '{  "policyId": "2f5573e6-5ba4-48f2-a75d-df99c936463b",  "connectionId": "84b500d7-71c8-4b1f-adf4-f1eb0000973d",  "workspaceId": "ef0efa32-d1c1-43d4-a5e2-fe7b4f00403c",  "targetOrganizationIds": [    "string"  ]}'
{  "results": [    {      "ok": true,      "organizationId": "string",      "organizationName": "string",      "error": "string",      "deployment": {        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",        "status": "string",        "deduped": true      }    }  ]}
POST/api/deployments/delete-failed

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
policyId?string

Only delete failed deployments of this policy. Omit to clear all of yours.

Formatuuid

Response Body

How many failed deployments were deleted.

application/json
  1. response
deletedCount?integer
deletedDeploymentIds?array<string>
curl -X POST 'https://www.p4a.ai/api/deployments/delete-failed' \  -H 'Content-Type: application/json' \  -d '{}'
{  "deletedCount": 0,  "deletedDeploymentIds": [    "string"  ]}
DELETE/api/deployments/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The deleted deployment id.

application/json
  1. response
deletedDeploymentId?string
curl -X DELETE 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "deletedDeploymentId": "string"}
POST/api/deployments/{id}/cancel

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X POST 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel'
{  "ok": true}
POST/api/deployments/{id}/delete-release

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The enqueued cleanup job, if one was created.

application/json
  1. response
job?|null
curl -X POST 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/delete-release'
{  "job": {}}
GET/api/deployments/{id}/dev-version

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The DEV-version probe result.

application/json
  1. response
dev_version_exists?boolean|null
curl -X GET 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/dev-version'
{  "dev_version_exists": true}
GET/api/deployments/{id}/history

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The deployment's jobs and most-recent logs.

application/json
  1. response
jobs?array<>
job?|null
logs?array<>
curl -X GET 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/history'
{  "jobs": [    {}  ],  "job": {},  "logs": [    {}  ]}
GET/api/deployments/{id}/logs

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

A text/event-stream of log chunks.

response?stringtext/event-stream
curl -X GET 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/logs'
"string"
POST/api/deployments/{id}/sync

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The reconciliation result.

application/json
  1. response
ok?boolean
result?string
Value in"in_sync""deleted""unknown"
status?string
curl -X POST 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/sync'
{  "ok": true,  "result": "in_sync",  "status": "string"}
POST/api/deployments/{id}/unpublish

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The enqueued unpublish job, if one was created.

application/json
  1. response
job?|null
curl -X POST 'https://www.p4a.ai/api/deployments/497f6eca-6276-4993-bfeb-53cbbbba6f08/unpublish'
{  "job": {}}

Connections

GET/api/connections

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Response Body

Your connections.

application/json
  1. response
connections?array<>
curl -X GET 'https://www.p4a.ai/api/connections'
{  "connections": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "host": "us",      "client_id": "string",      "organization_id": "string"    }  ]}
POST/api/connections

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
host*string
Value in"us""eu""custom"
customDomain?|
Formaturi
clientId*string
Length4 <= length
clientSecret*string
Length4 <= length
organizationId*string
Length4 <= length
name*string
Length2 <= length <= 80

Response Body

The created connection and credential validation result.

application/json
  1. response
connection?
validation?
curl -X POST 'https://www.p4a.ai/api/connections' \  -H 'Content-Type: application/json' \  -d '{  "host": "us",  "clientId": "string",  "clientSecret": "string",  "organizationId": "string",  "name": "string"}'
{  "connection": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "host": "us",    "client_id": "string",    "organization_id": "string"  },  "validation": {}}
GET/api/connections/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The connection.

application/json
  1. response
connection?
is_owner?boolean
curl -X GET 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "connection": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "host": "us",    "client_id": "string",    "organization_id": "string"  },  "is_owner": true}
PATCH/api/connections/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body

Credential fields (clientId, clientSecret, organizationId) are all-or-none.

name?string
host?string
Value in"us""eu""custom"
customDomain?|
Formaturi
clientId?string
Length4 <= length
clientSecret?string
Length4 <= length
organizationId?string
Length4 <= length

Response Body

The updated connection.

application/json
  1. response
connection?
curl -X PATCH 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "connection": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "host": "us",    "client_id": "string",    "organization_id": "string"  }}
DELETE/api/connections/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X DELETE 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "ok": true}
POST/api/connections/{id}/sync

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The connection, validation result, and deployment reconciliation summary.

application/json
  1. response
connection?
validation?
reconciliation?

Deployment reconciliation summary. null when credentials failed to validate or the probe sweep could not complete.

curl -X POST 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/sync'
{  "connection": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "host": "us",    "client_id": "string",    "organization_id": "string"  },  "validation": {},  "reconciliation": {    "in_sync": 0,    "unknown": 0,    "gone": [      {        "deployment_id": "6ef0ac85-9892-4664-a2a5-58bf2af5a8a6",        "policy_name": "string",        "version": "string",        "status": "published",        "mode": "publish"      }    ]  }}
GET/api/connections/{id}/orgs

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The organizations visible through the connection.

application/json
  1. response
orgs?array<>
curl -X GET 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/orgs'
{  "orgs": [    {      "id": "string",      "name": "string",      "isPrimary": true,      "fullPath": "string"    }  ]}
GET/api/connections/{id}/workspaces

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The workspace shares for this connection.

application/json
  1. response
shared?array<>
curl -X GET 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/workspaces'
{  "shared": [    {}  ]}
GET/api/connections/{id}/impact

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

Counts of dependents, for confirmation before deletion.

application/json
  1. response
active_deployments?integer
historical_deployments?integer
workspace_links?integer
has_credential?boolean
curl -X GET 'https://www.p4a.ai/api/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/impact'
{  "active_deployments": 0,  "historical_deployments": 0,  "workspace_links": 0,  "has_credential": true}
POST/api/connections/validate

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
host*string
Value in"us""eu""custom"
customDomain?|
Formaturi
clientId*string
Length4 <= length
clientSecret*string
Length4 <= length
organizationId*string
Length4 <= length

Response Body

Whether the credentials authenticate.

application/json
  1. response
ok?boolean
error?string
curl -X POST 'https://www.p4a.ai/api/connections/validate' \  -H 'Content-Type: application/json' \  -d '{  "host": "us",  "clientId": "string",  "clientSecret": "string",  "organizationId": "string"}'
{  "ok": true,  "error": "string"}

Workspaces

GET/api/workspaces

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Response Body

The workspaces you belong to.

application/json
  1. response
memberships?array<>
curl -X GET 'https://www.p4a.ai/api/workspaces'
{  "memberships": [    {}  ]}
POST/api/workspaces

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
name*string
Length2 <= length <= 80
slug?string
Length2 <= length <= 48

Response Body

The created workspace.

application/json
  1. response
workspace?
curl -X POST 'https://www.p4a.ai/api/workspaces' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
{  "workspace": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "slug": "string"  }}
GET/api/workspaces/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The workspace and its related data.

application/json
  1. response
workspace?
role?string

The caller's role. Null for a platform admin who is not a member.

Value in"owner""admin""member"
is_admin?boolean
caller_id?string
Formatuuid
connections?array<>
connectionStats?

Live counters keyed by connection id.

installedPolicies?array<>

Unique policies live through the workspace's connections, newest deployment first.

installedRulesets?array<>

Unique rulesets live through the workspace's connections, newest deployment first.

members?array<>

Empty for a personal workspace.

curl -X GET 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "workspace": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "slug": "string"  },  "role": "owner",  "is_admin": true,  "caller_id": "bc12a995-fda4-4e32-ba32-5851a0f06a0a",  "connections": [    {}  ],  "connectionStats": {    "property1": {      "deployments": 0,      "target_orgs": 0,      "live_policies": 0,      "ruleset_deployments": 0,      "ruleset_target_orgs": 0,      "live_rulesets": 0    },    "property2": {      "deployments": 0,      "target_orgs": 0,      "live_policies": 0,      "ruleset_deployments": 0,      "ruleset_target_orgs": 0,      "live_rulesets": 0    }  },  "installedPolicies": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "category": "string",      "description": "string",      "pdk_version": "string",      "owner_name": "string",      "company": "string",      "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",      "icon_url": "string",      "deploys_in_workspace": 0,      "latest_deployment_at": "2019-08-24T14:15:22Z"    }  ],  "installedRulesets": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "category": "string",      "description": "string",      "target_scopes": [        "string"      ],      "owner_name": "string",      "company": "string",      "submitted_by": "6703ac2f-9eb5-40e9-9fde-511b2dbf4be5",      "icon_url": "string",      "deploys_in_workspace": 0,      "latest_deployment_at": "2019-08-24T14:15:22Z"    }  ],  "members": [    {}  ]}
PATCH/api/workspaces/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
name*string
Length2 <= length <= 80

Response Body

The updated workspace.

application/json
  1. response
workspace?
curl -X PATCH 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
{  "workspace": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "slug": "string"  }}
POST/api/workspaces/{id}/archive

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The new archive timestamp.

application/json
  1. response
archived_at?string|null
curl -X POST 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/archive'
{  "archived_at": "string"}
DELETE/api/workspaces/{id}/archive

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The cleared archive timestamp.

application/json
  1. response
archived_at?string|null
curl -X DELETE 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/archive'
{  "archived_at": "string"}
GET/api/workspaces/{id}/members

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The members of the workspace.

application/json
  1. response
members?array<>
curl -X GET 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/members'
{  "members": [    {}  ]}
POST/api/workspaces/{id}/members

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
Properties2 <= properties
username?string

The invitee's @username (with or without a leading @).

email?string
Formatemail
role*string
Value in"admin""member"

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X POST 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/members' \  -H 'Content-Type: application/json' \  -d '{  "role": "admin"}'
{  "ok": true}
PATCH/api/workspaces/{id}/members/{userId}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid
userId*string
Formatuuid

Request Body

application/json
  1. body
role?string
Value in"admin""member"
disabled?false
Value infalse

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X PATCH 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{}'
{  "ok": true}
DELETE/api/workspaces/{id}/members/{userId}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid
userId*string
Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X DELETE 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "ok": true}
GET/api/workspaces/{id}/members/{userId}/impact

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid
userId*string
Formatuuid

Response Body

Counts of resources owned or authored by the member.

application/json
  1. response
role?string
Value in"owner""admin""member"
disabled_at?string|null
owned_shared_connections?integer
deployments_authored?integer
curl -X GET 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/members/497f6eca-6276-4993-bfeb-53cbbbba6f08/impact'
{  "role": "owner",  "disabled_at": "string",  "owned_shared_connections": 0,  "deployments_authored": 0}
POST/api/workspaces/{id}/connections

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
connection_id*string
Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X POST 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections' \  -H 'Content-Type: application/json' \  -d '{  "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9"}'
{  "ok": true}
PATCH/api/workspaces/{id}/connections

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
connection_id*string
Formatuuid
disabled?false
Value infalse

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X PATCH 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections' \  -H 'Content-Type: application/json' \  -d '{  "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9"}'
{  "ok": true}
DELETE/api/workspaces/{id}/connections

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Query Parameters

connection_id*string
Formatuuid

Response Body

Success.

application/json
  1. response
ok?boolean
curl -X DELETE 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections?connection_id=497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "ok": true}
GET/api/workspaces/{id}/connections/{connectionId}/impact

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid
connectionId*string
Formatuuid

Response Body

Counts describing the shared connection's visibility and use.

application/json
  1. response
is_disabled?boolean
disabled_reason?string|null
members_visible?integer
deployments_authored?integer
curl -X GET 'https://www.p4a.ai/api/workspaces/497f6eca-6276-4993-bfeb-53cbbbba6f08/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/impact'
{  "is_disabled": true,  "disabled_reason": "string",  "members_visible": 0,  "deployments_authored": 0}

Transfers

POST/api/policies/{id}/transfers

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
Properties1 <= properties
recipientUsername?string

The recipient's @username (with or without a leading @).

recipientEmail?string
Formatemail

Response Body

The created transfer.

application/json
  1. response
transfer?
curl -X POST 'https://www.p4a.ai/api/policies/497f6eca-6276-4993-bfeb-53cbbbba6f08/transfers' \  -H 'Content-Type: application/json' \  -d '{}'
{  "transfer": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "to_user_id": "bdcaa974-8e23-4fc9-823d-e060850bbef1"  }}
POST/api/transfers/{id}/accept

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The accepted transfer and the resource now owned.

application/json
  1. response
transfer?
resourceType?string
Value in"policy""idea""ruleset"
resourceId?string
Formatuuid
curl -X POST 'https://www.p4a.ai/api/transfers/497f6eca-6276-4993-bfeb-53cbbbba6f08/accept'
{  "transfer": {},  "resourceType": "policy",  "resourceId": "026d60bb-63a8-407e-bf67-01dcfc6022e6"}
POST/api/transfers/{id}/cancel

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The cancelled transfer.

application/json
  1. response
transfer?
curl -X POST 'https://www.p4a.ai/api/transfers/497f6eca-6276-4993-bfeb-53cbbbba6f08/cancel'
{  "transfer": {}}
POST/api/transfers/{id}/reject

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Request Body

application/json
  1. body
feedback?string
Lengthlength <= 4000

Response Body

The rejected transfer.

application/json
  1. response
transfer?
curl -X POST 'https://www.p4a.ai/api/transfers/497f6eca-6276-4993-bfeb-53cbbbba6f08/reject' \  -H 'Content-Type: application/json' \  -d '{}'
{  "transfer": {}}

Tokens

GET/api/tokens

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Response Body

Your tokens (secrets are never returned).

application/json
  1. response
tokens?array<>
curl -X GET 'https://www.p4a.ai/api/tokens'
{  "tokens": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "name": "string",      "token_prefix": "string",      "scopes": [        "api:read"      ],      "expires_at": "2019-08-24T14:15:22Z",      "last_used_at": "2019-08-24T14:15:22Z",      "revoked_at": "2019-08-24T14:15:22Z",      "created_at": "2019-08-24T14:15:22Z"    }  ]}
POST
/api/tokens

Authorization

cookieAuth
cookiesb-access-token<token>

A signed-in browser session cookie. Used only by POST /api/tokens, which mints new tokens and therefore rejects personal access tokens — a token cannot mint another token. This operation cannot be exercised from the interactive playground; create tokens from the dashboard Settings page.

Request Body

application/json
  1. body
name*string
Length1 <= length <= 100
scopes*array<>
Items1 <= items
expiresInDays?|
Value in3090365null

Response Body

The new token's secret (shown once) and its record.

application/json
  1. response
token?string
record?
curl -X POST 'https://www.p4a.ai/api/tokens' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "scopes": [    "api:read"  ]}'
{  "token": "string",  "record": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "token_prefix": "string",    "scopes": [      "api:read"    ],    "expires_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z"  }}
DELETE/api/tokens/{id}

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Path Parameters

id*string

The resource's UUID.

Formatuuid

Response Body

The revoked token's record.

application/json
  1. response
ok?boolean
record?
curl -X DELETE 'https://www.p4a.ai/api/tokens/497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "ok": true,  "record": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "name": "string",    "token_prefix": "string",    "scopes": [      "api:read"    ],    "expires_at": "2019-08-24T14:15:22Z",    "last_used_at": "2019-08-24T14:15:22Z",    "revoked_at": "2019-08-24T14:15:22Z",    "created_at": "2019-08-24T14:15:22Z"  }}

Account

GET/api/me

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Response Body

Your profile.

application/json
  1. response
user?
curl -X GET 'https://www.p4a.ai/api/me'
{  "user": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "email": "user@example.com",    "company": "string",    "username": "string",    "bio": "string",    "linkedinUrl": "string",    "xUrl": "string",    "profileIsPublic": true,    "is_admin": true  }}
PATCH/api/me

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Request Body

application/json
  1. body
company?string
Length1 <= length <= 120
username?string

Your unique @-mention handle: 3–30 chars, lowercased, [a-z0-9] with internal _/- (no leading/trailing separator). Must be unique across all users.

Match^[a-z0-9][a-z0-9_-]{1,28}[a-z0-9]$
Length3 <= length <= 30
bio?|

Optional short public bio (1–1000 chars). Send null (or an empty string) to clear it. Only visible to others when profileIsPublic is true.

Lengthlength <= 1000
linkedinUrl?|

Optional LinkedIn profile URL. Must be an https:// link to linkedin.com (any country subdomain). Send null to clear. Only visible to others when profileIsPublic is true.

xUrl?|

Optional X / Twitter profile URL. Must be an https:// link to x.com or twitter.com. Send null to clear. Only visible to others when profileIsPublic is true.

profileIsPublic?boolean

Opt-in gate: when true, your bio and social links are exposed on your public profile (GET /api/users/{username}). Default false (private). Your name, company, and username are always public regardless.

Response Body

Your updated profile.

application/json
  1. response
user?
curl -X PATCH 'https://www.p4a.ai/api/me' \  -H 'Content-Type: application/json' \  -d '{}'
{  "user": {    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",    "email": "user@example.com",    "company": "string",    "username": "string",    "bio": "string",    "linkedinUrl": "string",    "xUrl": "string",    "profileIsPublic": true,    "is_admin": true  }}
GET/api/me/transfers

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal access token, sent as Authorization: Bearer p4a_….

Query Parameters

role?string
Value in"recipient""initiator"

Response Body

Transfers where you are the recipient or initiator.

application/json
  1. response
transfers?array<>
curl -X GET 'https://www.p4a.ai/api/me/transfers'
{  "transfers": [    {      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",      "resource_type": "policy",      "resource_id": "4d5215ed-38bb-48ed-879a-fdb9ca58522f",      "resource_name": "string",      "policy_id": "ee9b03e0-6495-427a-85a5-34444d24ae04",      "policy_name": "string",      "status": "string",      "feedback": "string",      "created_at": "2019-08-24T14:15:22Z",      "decided_at": "2019-08-24T14:15:22Z",      "expires_at": "2019-08-24T14:15:22Z",      "counterparty_name": "string",      "counterparty_email": "string",      "role": "recipient"    }  ]}

References

On this page