---
title: "POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants"
method: POST
path: "/api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants"
tags: ["Flipt", "VariantsService"]
---

# POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants

`POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants`

## Request

- Base URL: `http://localhost:8080`
- URL: `http://localhost:8080/api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants`
- Auth: HTTP bearer

## Path parameters

- `namespaceKey` string, required
- `flagKey` string, required

## Request body

- CreateVariantRequest
  - `flagKey` string
  - `key` string, required
  - `name` string
  - `description` string
  - `attachment` string
  - `namespaceKey` string

## Response `200`

OK

- Variant
  - `id` string
  - `flagKey` string
  - `key` string
  - `name` string
  - `description` string
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `attachment` string
  - `namespaceKey` string

---

[API](https://skmtc.dev/flipt-io/apis/flipt-api.md) - [All operations](https://skmtc.dev/flipt-io/apis/flipt-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flipt-io/apis/flipt-api/revisions/6fe4caf26f13?raw)
