Fetch a policy (latest version)
const url = 'https://example.com/v1/policies/example';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 \ --header 'Authorization: Bearer <token>'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).
Responses
Section titled “Responses”Latest policy version.
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. For retention, { v: 1, doc: RetentionSpec } from @kindgi/policy-contract (domain / graceSeconds / mode, which must be purge); a tenant has one retention policy per domain, plus one for *. tool-errors, hitl and retention specs are validated on publish. For other kinds, the shape is defined by the runtime consumer.
object
Example
{ "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" }}See also
GET /v1/policies/{policyId}/versions: List versions of a policyGET /v1/policies/{policyId}/versions/{version}: Fetch a specific policy versionPOST /v1/policies/{policyId}/versions/{version}/unregister: Unregister a policy versionPOST /v1/policies/{policyId}/versions/{version}/reinstate: Reinstate a specific tombstoned policy version- Every error code