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

# Update Feature Flag

> Change a flag's value, runtime, name, description or archived state

Renames, archives, or sets a flag's value — the change your servers pick up on their next poll.

## Authorization

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication. Format: `Bearer <your-api-key>`
</ParamField>

## Required Permission

`FLAGS_WRITE`

## Path Parameters

<ParamField path="flagId" type="string" required>
  The flag's UUID.
</ParamField>

## Body Parameters

Every field is optional — send only what you are changing.

<ParamField body="name" type="string">
  New name, 1–100 characters.
</ParamField>

<ParamField body="description" type="string | null">
  New description, up to 500 characters. Send `null` to clear it.
</ParamField>

<ParamField body="type" type="string">
  The kind of value the flag holds. **Must be sent together with `value`.**
</ParamField>

<ParamField body="value" type="JsonValue">
  The new value. **Must be sent together with `type`.**
</ParamField>

<ParamField body="runtime" type="string">
  `shared` or `server`. Unlike the key, the runtime is mutable — a flag made
  client-readable by mistake can be closed without recreating it under a new key.
</ParamField>

<ParamField body="archived" type="boolean">
  `true` removes the flag from the published payload, so servers stop seeing it.
  `false` restores it. The flag itself is kept either way, so its key cannot be
  silently reused.
</ParamField>

<Note>
  **The key cannot be changed.** Servers reference a flag by key, so renaming one
  would silently orphan every server reading it. Delete the flag and create a new
  one if you need a different key.
</Note>

<Warning>
  Changing the value means restating the type. The pair is what servers parse,
  and validating them together is what keeps a `number` flag from ending up
  holding a string. Sending one without the other fails with `400`.
</Warning>

## Response

Returns the updated flag — the same shape as a single entry in
[`GET /flags`](/cloud/api-reference/flags/list).

## Status Codes

| Status | Meaning                                                              |
| ------ | -------------------------------------------------------------------- |
| `200`  | The updated flag                                                     |
| `400`  | Validation failed, or `type` and `value` were not sent together      |
| `401`  | Invalid or missing API key                                           |
| `403`  | The key lacks `FLAGS_WRITE`, or the flag is locked by your allowance |
| `404`  | No such flag in this organization                                    |
| `409`  | Attempted to change the value of an archived flag                    |

### Locked flags

A flag beyond your allowance rejects edits to its name, description, value and runtime with `403`. Archiving and deleting stay allowed — they are how you get back under the allowance. See [Feature Flags](/cloud/offers/feature-flags#locked-flags).

<RequestExample>
  ```bash cURL (flip a boolean) theme={null}
  curl -X PATCH "https://api.nonefivem.com/cloud/flags/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{ "type": "boolean", "value": false }'
  ```

  ```bash cURL (archive) theme={null}
  curl -X PATCH "https://api.nonefivem.com/cloud/flags/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{ "archived": true }'
  ```

  ```bash cURL (close to clients) theme={null}
  curl -X PATCH "https://api.nonefivem.com/cloud/flags/550e8400-e29b-41d4-a716-446655440000" \
    -H "Authorization: Bearer your-api-key" \
    -H "Content-Type: application/json" \
    -d '{ "runtime": "server" }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    `https://api.nonefivem.com/cloud/flags/${flagId}`,
    {
      method: "PATCH",
      headers: {
        Authorization: "Bearer your-api-key",
        "Content-Type": "application/json"
      },
      body: JSON.stringify({
        type: "json",
        value: { payMultiplier: 2, taxRate: 0.05 }
      })
    }
  );
  const flag = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "key": "new-hud",
    "name": "New HUD",
    "description": "Rolls out the redesigned heads-up display",
    "type": "boolean",
    "value": false,
    "runtime": "shared",
    "archived": false,
    "locked": false,
    "createdAt": "2026-09-01T10:00:00.000Z",
    "updatedAt": "2026-09-19T12:30:00.000Z"
  }
  ```

  ```json 403 Locked theme={null}
  {
    "message": "This flag is beyond your plan's limit of 5 feature flags. It keeps serving its current value, but subscribe again or remove another flag to edit it."
  }
  ```
</ResponseExample>
