PgBeam Docs
Policies

Get a policy profile

GET
/v1/projects/{project_id}/policies/{policy_id}

Returns a single policy profile by ID.

Authorization

AuthorizationBearer <token>

JWT issued by Better Auth. Verified via JWKS.

In: header

Path Parameters

project_id*string

Unique project identifier (prefixed, e.g. prj_xxx).

policy_id*string

Unique policy profile identifier (prefixed, e.g. pol_xxx).

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://example.com/v1/projects/string/policies/string"
{  "id": "pol_01h455vb4pex5vsknk084sn02q",  "project_id": "prj_01h455vb4pex5vsknk084sn02q",  "name": "Read-only analytics",  "access_mode": "read_only",  "statement_rules": {    "allow": [      "string"    ],    "deny": [      "string"    ]  },  "table_allowlist": [    "string"  ],  "table_denylist": [    "string"  ],  "masking_rules": [    {      "table": "users",      "column": "email",      "kind": "redact"    }  ],  "budget_queries_per_hour": 0,  "budget_queries_per_day": 0,  "max_rows": 0,  "statement_timeout_ms": 0,  "row_filters": [    {      "table": "orders",      "predicate": "tenant_id = current_setting('pgbeam.tenant')"    }  ],  "write_mode": "normal",  "approval_mode": "off",  "approval_auto_max_rows": 0,  "approval_timeout_seconds": 300,  "migration_safety": "off",  "egress_bytes_per_day": 0,  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}
{  "error": {    "code": "string",    "message": "string"  }}