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. tool-errors and hitl 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" }}