Skip to main content

Policies

GET/v1/policies/{tenant_id}/{app_id}/{agent_id}/{env}/history

Get 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/sdk

Path parameters

NameTypeRequiredDescription
tenant_id#pathstringrequired
app_id#pathstringrequired
agent_id#pathstringrequired
env#pathstringrequired

Query parameters

NameTypeRequiredDescription
limit#queryintegeroptional

Responses

StatusDescription
200Successful Response
422Validation Error

Response schema

versionsrequired

Errors & what triggers them

CodeTriggerFix
401Missing or expired Authorization header.
403Token does not have org access (wrong org_id, or insufficient role).
404Resource 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