# Get a gate policy version

GET

/v1/gate-policies/{policyId}/versions/{version}

```sh
curl --request GET \
  --url https://example.com/v1/gate-policies/example/versions/example \
  --header 'Authorization: Bearer <token>'
```

## Authorizations

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

## Parameters

### Path Parameters

**policyId**

required

string

The gate policy id.

**version**

required

string

A semver version of the gate policy.

## Responses

### 200

The version.

application/json

object

**id**

required

string

**version**

required

string

**agentId**

required

string

**scope**

required

One of: discriminator: kind

- **object**

  The agent’s default for the whole tenant.

  object

  **kind**

  required

  string

  Allowed values: tenant

- **object**

  An org’s projects.

  object

  **kind**

  required

  string

  Allowed values: org

  **orgId**

  required

  string format: uuid

- **object**

  One project.

  object

  **kind**

  required

  string

  Allowed values: project

  **projectId**

  required

  string format: uuid

- **object**

  A segment path within a project: it covers every run whose path starts with it.

  object

  **kind**

  required

  string

  Allowed values: segment

  **projectId**

  required

  string format: uuid

  **path**

  required

  Array\<object>

  \>= 1 items <= 8 items

  object

  **key**

  required

  Lowercase, like an identifier: `company`, `contact-role`.

  string

  /^\[a-z]\[a-z0-9\_-]{0,63}$/

  **value**

  required

  string

  \>= 1 characters <= 256 characters

**spec**

required

What a promotion must show. Every part is optional; an empty spec checks nothing. A promotion must name a comparison (`evalRunId`) exactly when the spec has `comparison`, `evidence`, `metrics`, `replay` or `onlyRestrictedClasses`. Unknown keys are refused.

object

**comparison**

object

**maxAgeHours**

number

\> 0

**suite**

object

**id**

required

string

**version**

string

**evidence**

The judged evidence behind each gated metric; for a metric with `maxDrop`, the baseline’s too.

object

**minCases**

integer

**minWeight**

number

**metrics**

Array\<object>

object

**name**

required

string

Allowed values: weightedYesShare judgedCoverage weightedPrecisionAtK

**k**

`weightedPrecisionAtK` only: the summary’s `k` must be this.

integer

\>= 1 <= 100

**minCandidate**

number

<= 1

**maxDrop**

How far the candidate may fall below the baseline (the live version).

number

<= 1

**replay**

Each knob left out of the block is 0. No block: no replay checks.

object

**maxDiverged**

integer

**maxErrors**

integer

**maxRefusedWrites**

integer

**maxStopped**

integer

**approvals**

A passing promotion waits for a reviewer.

object

**role**

Default `senior`.

string

Allowed values: standard senior admin

**separateApprover**

Default `true`.

boolean

**onlyRestrictedClasses**

Only restricted judge classes count: the comparison must be weighted `restricted-only`, so a class anyone may assert can’t move the gate.

boolean

**description**

string

**createdAt**

required

string format: date-time

**unregisteredAt**

string format: date-time

##### Example

```json
{
  "scope": {
    "kind": "tenant"
  },
  "spec": {
    "metrics": [
      {
        "name": "weightedYesShare"
      }
    ],
    "approvals": {
      "role": "standard"
    }
  }
}
```

### 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 such version.

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/gate-policies/{policyId}`: Get a gate policy](https://docs.kindgi.com/v0.1.10/reference/api/operations/gatepoliciesget.md)
- [`GET /v1/gate-policies/{policyId}/versions`: List a gate policy's versions](https://docs.kindgi.com/v0.1.10/reference/api/operations/gatepoliciesversionslist.md)
- [`POST /v1/gate-policies/{policyId}/versions/{version}/unregister`: Unregister a gate policy version](https://docs.kindgi.com/v0.1.10/reference/api/operations/gatepoliciesversionsunregister.md)
- [`POST /v1/gate-policies/{policyId}/versions/{version}/reinstate`: Reinstate a gate policy version](https://docs.kindgi.com/v0.1.10/reference/api/operations/gatepoliciesversionsreinstate.md)
- [Every error code](https://docs.kindgi.com/v0.1.10/reference/errors.md)
