---
title: "POST /flags"
method: POST
path: "/flags"
tags: ["flag"]
---

# POST /flags

`POST /flags`

## Request body

- CreateFlagRequest
  - `description` string, required
  - `key` string — unique key representation of the flag

## Response `200`

returns the created flag

- Flag
  - `id` integer
  - `key` string — unique key representation of the flag
  - `description` string, required
  - `enabled` boolean, required
  - `segments` Segment[]
    - `id` integer
    - `description` string, required
    - `constraints` Constraint[]
      - `id` integer
      - `property` string, required
      - `operator` 'EQ' | 'NEQ' | 'LT' | 'LTE' | 'GT' | 'GTE' | 'EREG' | 'NEREG' | 'IN' | 'NOTIN' | 'CONTAINS' | 'NOTCONTAINS', required
      - `value` string, required
    - `distributions` Distribution[]
      - `id` integer
      - `percent` integer, required
      - `variantKey` string, required
      - `variantID` integer, required
    - `rank` integer, required
    - `rolloutPercent` integer, required
  - `variants` Variant[]
    - `id` integer
    - `key` string, required
    - `attachment` object
  - `dataRecordsEnabled` boolean, required — enabled data records will get data logging in the metrics pipeline, for example, kafka.
  - `entityType` string — it will override the entityType in the evaluation logs if it's not empty
  - `notes` string — flag usage details in markdown format
  - `createdBy` string
  - `updatedBy` string
  - `updatedAt` string, date-time

## Other responses

- `default` — generic error response

---

[API](https://skmtc.net/checkr/apis/flagr.md) · [All operations](https://skmtc.net/checkr/apis/flagr/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/checkr/flagr/versions/67717c0f1f1a/schema)
