Policy Grid Actions APIs
The Policy Grid Actions API lets external integrators discover and execute workflow actions (e.g. Approve, Reject) defined inside Guardian policy grid containers β without reverse-engineering the internal policy block structure or touching any ephemeral block UUID.
Concept
A Guardian policy organises its UI into grid containers (interfaceDocumentsSourceBlock). Each grid contains rows (VC documents) and action controls bound to individual columns. Three kinds of controls are supported:
Selector / button actions (Approve/Reject-style) β apply a fixed field mutation, body is
{}.Dropdown actions β assign a value chosen from a live list (e.g. assigning a VVB to a project), body is
{ "value": "..." }.Request-VC-document actions β submit a form that mints a brand-new signed VC referencing the row (e.g. "Submit Final Amount"), body is
{ "document": { ... } }.
The exact body shape for a given action is always described by its inputSchema, returned by List Actions β check it rather than assuming an empty body works.
The Grid Actions API exposes three stable abstractions:
Grid
gridId β the block's author-assigned .tag, or sha256(uuid).slice(0,16) fallback
Stable across policy redeploys
Action
actionId β the option .tag (for selector actions) or the block .tag / hash fallback
Returned by List Actions
Record
_id β the MongoDB document _id returned by Get Records
Use verbatim in Execute Action call
Block UUIDs are never exposed in any request or response.
Authentication
All endpoints require a valid Guardian JWT bearer token in the Authorization header. The caller must hold at least one of:
POLICIES_POLICY_EXECUTEPOLICIES_POLICY_MANAGE
Actions are further filtered by the caller's policy role β the API never returns or allows execution of actions whose requiredRoles the caller does not hold.
Endpoints
Workflow Example β Approve a Document
Step 1 β Discover grids
GET /policies/{policyId}/grids
Step 2 β List available actions
GET /policies/{policyId}/grids/installer_documents_grid/actions
Step 3 β Fetch records
GET /policies/{policyId}/grids/installer_documents_grid/records?pageSize=1
Step 4 β Execute the approve action
POST /policies/{policyId}/grids/installer_documents_grid/records/6627f3b2e4b0c1a2b3c4d5e6/actions/approve_action
Request body:
Response 200 OK:
Step 5 β Confirm the change
Re-fetch the record β option.status is now "Approved":
Error Reference
400
Execute Action call is missing a body field the action requires (value for dropdown, document for request-VC-document)
401
Missing or invalid JWT
403
Caller lacks required permission (POLICIES_POLICY_EXECUTE / POLICIES_POLICY_MANAGE)
404
gridId, actionId, or recordId not found
503
Policy instance not running, or grid / action not available to the caller's role
500
Unexpected internal error
Last updated