Policies
GET
/v1/policies/{tenant_id}/{app_id}/{agent_id}/{env}/historyGet Version History
Get version history for a policy scope. **Query Parameters**: - `limit`: Maximum number of versions to return (default: 10) **Returns**: - List of versions ordered by version_number (descending) - Indicates which version is currently active
Runtime, CI or Admin tokenscope: readoperation_id: policies.history
Authentication
Any bearer token belonging to the org can read this endpoint.
SDK install
pip install znyx-sdknpm install @znyx/sdkPath parameters
| Name | Type | Required | Description |
|---|---|---|---|
| tenant_id#path | string | required | — |
| app_id#path | string | required | — |
| agent_id#path | string | required | — |
| env#path | string | required | — |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| limit#query | integer | optional | — |
Responses
| Status | Description |
|---|---|
| 200 | Successful Response |
| 422 | Validation Error |
Response schema
versionsrequired
Errors & what triggers them
| Code | Trigger | Fix |
|---|---|---|
| 401 | Missing or expired Authorization header. | — |
| 403 | Token does not have org access (wrong org_id, or insufficient role). | — |
| 404 | Resource does not exist in this org. | — |
Request
curl -X GET 'https://api.znyx.ai/v1/policies/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000/00000000-0000-0000-0000-000000000000/prod/history' \ -H 'Authorization: Bearer $ZNYX_TOKEN'
Response
application/json
Successful Response
{
"versions": [
{
"version_number": 0,
"created_at": null,
"created_by": null,
"change_reason": null,
"is_active": false
}
]
}Schema: object