List versions of a policy
const url = 'https://example.com/v1/policies/example/versions?limit=25&includeTombstoned=false';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/v1/policies/example/versions?limit=25&includeTombstoned=false' \ --header 'Authorization: Bearer <token>'Cursor-paginated list of policy versions. Defaults to active-only. Pass ?includeTombstoned=true to include soft-tombstoned rows too; tombstoned rows carry unregisteredAt (ISO string), active rows do not.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”PolicyId — stable string chosen by the caller (e.g. acme.model-routing).
Query Parameters
Section titled “Query Parameters”1..100. Default 25.
Opaque cursor from a prior response. Absent → first page.
When true, the response includes soft-tombstoned versions in addition to active ones. Tombstoned rows carry an unregisteredAt ISO timestamp; active rows omit the field. Default: false (active-only).
Responses
Section titled “Responses”Page of policy versions.
object
object
Semver — publishing a modified policy produces a new version.
Kind-specific policy body. For access-control, matches @kindgi/specs/policy.schema.json (rules + defaults). For model-routing, matches TenantPolicy from @kindgi/capabilities (providers.allow / providers.deny / models.allow / models.deny / regionAllow / maxCostPerCallUsd / maxTokensPerCall). For tool-errors, ToolErrorsSpec (maxRetries / retryOn). For hitl, HitlSpec from @kindgi/policy-contract (maxTimeoutMs / minReviewerRole / tools — per tool id a mode or { mode, requiredRole }); it only tightens an agent’s approvals. tool-errors and hitl specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.
object
ISO 8601 timestamp — present iff this version has been soft-tombstoned via POST /versions/:v/unregister. Absent on active versions.
Example
{ "data": [ { "kind": "access-control" } ]}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No policy with that id under this tenant.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}