# Get constraint

`GET /v1/constraints/{constraint}`, operation `constraints.GetConstraint`

Gets a constraint.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `constraint` | path | Yes | `string` | The constraint's ID, such as environments.maxDiskGib. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `category` | `string` | Yes | What the constraint governs: a guardrail or data retention. Values: `guardrail`, `retention`. |
| `defaultMax` | `integer (int64)` | No | Of a max: the most kosem itself allows where no policy sets a max, its maxValue; absent where nothing limits it then, as how long a stopped environment is kept. |
| `description` | `string` | Yes | What the constraint restricts, and how. |
| `displayName` | `string` | Yes | Name shown in user interfaces. |
| `entitlement` | `string` | No | Of a max bounded by plan: the feature ID whose plan value caps it. |
| `maxValue` | `integer (int64)` | No | The most that a max's policy may set. |
| `minValue` | `integer (int64)` | No | The least that a max's policy may set. |
| `name` | `string` | Yes | Resource name, constraints/{constraint_id}, such as constraints/environments.maxDiskGib. |
| `organizationOnly` | `boolean` | No | Set on a constraint whose policies only organizations set. |
| `type` | `string` | Yes | How its policies say what they allow: boolean, enforced or not; allowList, the values allowed; max, the most allowed. An organization's policy and its project's combine by the stricter. Values: `boolean`, `allowList`, `max`. |
| `unit` | `string` | No | What a max counts, such as GiB. |
| `values` | `ConstraintValue[]` | No | The values that an allow-list's policies may name, in kosem's order. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.