---
title: "Get variants for a feature in an environment"
method: GET
path: "/api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/variants"
tags: ["Features"]
---

# Get variants for a feature in an environment

`GET /api/admin/projects/{projectId}/features/{featureName}/environments/{environment}/variants`

Returns the variants for a feature in a specific environment. If the feature has no variants it will return an empty array of variants

## Path parameters

- `projectId` string, required
- `featureName` string, required
- `environment` string, required

## Response `200`

featureVariantsSchema

- FeatureVariantsSchema — A versioned collection of feature flag variants.
  - `version` integer, required — The version of the feature variants schema.
  - `variants` VariantSchema[], required — All variants defined for a specific feature flag.
    - `name` string, required — The variants name. Is unique for this feature flag
    - `weight` number, required — The weight is the likelihood of any one user getting this variant. It is a number between 0 and 1000. See the section on [variant weights](https://docs.getunleash.io/concepts/feature-flag-variants#variant-weight) for more information
    - `weightType` 'variable' | 'fix' — Set to fix if this variant must have exactly the weight allocated to it. If the type is variable, the weight will adjust so that the total weight of all variants adds up to 1000
    - `stickiness` string — [Stickiness](https://docs.getunleash.io/concepts/feature-flag-variants#variant-stickiness) is how Unleash guarantees that the same user gets the same variant every time
    - `payload` object — Extra data configured for this variant
      - `type` 'json' | 'csv' | 'string' | 'number', required — The type of the value. Commonly used types are string, number, json and csv.
      - `value` string, required — The actual value of payload
    - `overrides` OverrideSchema[] — Overrides assigning specific variants to specific users. The weighting system automatically assigns users to specific groups for you, but any overrides in this list will take precedence.
      - `contextName` string, required — The name of the context field used to determine overrides
      - `values` string[], required — Which values that should be overriden

## Other responses

- `401` — Authorization information is missing or invalid. Provide a valid API token as the `authorization` header, e.g. `authorization:*.*.my-admin-token`.
- `403` — The provided user credentials are valid, but the user does not have the necessary permissions to perform this operation
- `404` — The requested resource was not found.

---

[API](https://skmtc.dev/unleash/apis/unleash-api-3.md) · [All operations](https://skmtc.dev/unleash/apis/unleash-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/unleash/unleash-api-3/revisions/b2c3116e633e/schema)
