# List versions of a policy

GET

/v1/policies/{policyId}/versions

```sh
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

- **[bearerAuth](https://docs.kindgi.com/v0.1.8/reference/api.md#bearerauth)**

## Parameters

### Path Parameters

**policyId**

required

string

\>= 1 characters

PolicyId — stable string chosen by the caller (e.g. `acme.model-routing`).

### Query Parameters

**limit**

integer

default: 25 >= 1 <= 100

1..100. Default 25.

**cursor**

string

Where the previous page ended: its `nextCursor`, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise `400 bad-input`, and the list starts again without it. Absent → first page.

**includeTombstoned**

boolean

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

### 200

Page of policy versions.

application/json

object

**data**

required

Array\<object>

object

**id**

required

string

\>= 1 characters

**tenantId**

required

string format: uuid

**version**

required

Semver — publishing a modified policy produces a new version.

string

/^\d+\\.\d+\\.\d+$/

**kind**

required

string

Allowed values: access-control model-routing adapter-allowlist rate-limit retention compliance tool-errors hitl

**description**

string

**spec**

required

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

**_key_**

additional properties

any

**unregisteredAt**

ISO 8601 timestamp — present iff this version has been soft-tombstoned via `POST /versions/:v/unregister`. Absent on active versions.

string format: date-time

**nextCursor**

string

**hasMore**

required

boolean

##### Example

```json
{
  "data": [
    {
      "kind": "access-control"
    }
  ]
}
```

### 400

`bad-input`: a `cursor` this list didn’t issue.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 401

Missing / malformed / expired / revoked bearer token.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

### 404

No policy with that id under this tenant.

application/json

object

**error**

required

object

**code**

required

Stable machine-readable discriminant. Values match domain error codes (see `docs/API-ROUTE-CONVENTIONS.md` §4.3).

string

**message**

required

string

**details**

Optional, kind-specific.

object

**_key_**

additional properties

any

**requestId**

required

Server-assigned request id; also echoed via `X-Request-Id` header.

string

##### Examplegenerated

```json
{
  "error": {
    "code": "example",
    "message": "example",
    "details": {},
    "requestId": "example"
  }
}
```

## See also

- [`GET /v1/policies/{policyId}`: Fetch a policy (latest version)](https://docs.kindgi.com/v0.1.8/reference/api/operations/policiesget.md)
- [`GET /v1/policies/{policyId}/versions/{version}`: Fetch a specific policy version](https://docs.kindgi.com/v0.1.8/reference/api/operations/policiesversionsget.md)
- [`POST /v1/policies/{policyId}/versions/{version}/unregister`: Unregister a policy version](https://docs.kindgi.com/v0.1.8/reference/api/operations/policiesversionsunregister.md)
- [`POST /v1/policies/{policyId}/versions/{version}/reinstate`: Reinstate a specific tombstoned policy version](https://docs.kindgi.com/v0.1.8/reference/api/operations/policiesreinstateversion.md)
- [Error code `bad-input`](https://docs.kindgi.com/v0.1.8/reference/errors.md#bad-input)
- [Every error code](https://docs.kindgi.com/v0.1.8/reference/errors.md)
