> ## Documentation Index
> Fetch the complete documentation index at: https://feather.mupeni.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Flag

> Creates a flag and seeds a disabled v1 config in every environment.

## Path parameters

<ParamField path="projectId" type="string" required />

## Body

<ParamField body="key" type="string" required>
  Developer-facing identifier. Must match `^[a-z0-9-_]+$`. Unique within the project. **Immutable
  after creation.**
</ParamField>

<ParamField body="name" type="string" required>
  Display name.
</ParamField>

<ParamField body="type" type="&#x22;boolean&#x22; | &#x22;string&#x22; | &#x22;number&#x22;" required>
  Determines the type of `defaultValue` and rule `value` fields.
</ParamField>

<ParamField body="description" type="string">
  Optional description.
</ParamField>

<ParamField body="clientSafe" type="boolean">
  If `true`, the flag is included in the public bundle served to browser SDKs. Defaults to `false`.
</ParamField>

<RequestExample>
  ```bash theme={null}
  curl -X POST https://nest.feather.mupeni.dev/v1/projects/proj_01hx.../flags \
    -H "Authorization: Bearer <server_key>" \
    -H "Content-Type: application/json" \
    -d '{
      "key": "new-checkout",
      "name": "New Checkout Flow",
      "type": "boolean",
      "description": "Enables the redesigned checkout experience."
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 theme={null}
  {
    "id": "flag_01hx...",
    "orgId": "org_01hx...",
    "projectId": "proj_01hx...",
    "key": "new-checkout",
    "name": "New Checkout Flow",
    "description": "Enables the redesigned checkout experience.",
    "type": "boolean",
    "clientSafe": false,
    "archivedAt": null,
    "createdAt": "2024-04-01T09:00:00.000Z"
  }
  ```

  ```json 409 theme={null}
  {
    "error": {
      "code": "CONFLICT",
      "message": "Flag key 'new-checkout' already exists in this project."
    }
  }
  ```

  ```json 207 theme={null}
  {
    "id": "flag_01hx...",
    "key": "new-checkout",
    "syncWarning": "Edge cache sync failed: timeout. Config saved but evaluations may serve stale data."
  }
  ```
</ResponseExample>
