---
title: "Update flag settings for user"
method: PUT
path: "/api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}"
tags: ["User settings"]
deprecated: true
---

# Update flag settings for user

`PUT /api/v2/users/{projectKey}/{environmentKey}/{userKey}/flags/{featureFlagKey}`

> **Deprecated.**

Enable or disable a feature flag for a user based on their key.

Omitting the `setting` attribute from the request body, or including a `setting` of `null`, erases the current setting for a user.

If you previously patched the flag, and the patch included the user's data, LaunchDarkly continues to use that data. If LaunchDarkly has never encountered the user's key before, it calculates the flag values based on the user key alone.

## Path parameters

- `projectKey` string, string, required — The project key
- `environmentKey` string, string, required — The environment key
- `userKey` string, string, required — The user key
- `featureFlagKey` string, string, required — The feature flag key

## Request body

- ValuePut
  - `setting` string — The variation value to set for the context. Must match the flag's variation type.
  - `comment` string — Optional comment describing the change

## Response `204`

Action succeeded

## Other responses

- `400` — Invalid request
- `401` — Invalid access token
- `403` — Forbidden
- `404` — Invalid resource identifier
- `429` — Rate limited

---

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