---
title: "Archive a feature flag"
method: POST
path: "/api/v2/feature-flags/{feature_flag_id}/archive"
tags: ["Feature Flags"]
---

# Archive a feature flag

`POST /api/v2/feature-flags/{feature_flag_id}/archive`

Archives a feature flag. Archived flags are
hidden from the main list but remain accessible and can be unarchived.

## Path parameters

- `feature_flag_id` string, uuid, required

## Response `200`

OK

- FeatureFlagResponse — Response containing a feature flag.
  - `data` FeatureFlag, required — A feature flag resource.
    - `attributes` FeatureFlagAttributes, required — Attributes of a feature flag.
      - `archived_at` string, date-time, nullable — The timestamp when the feature flag was archived.
      - `created_at` string, date-time — The timestamp when the feature flag was created.
      - `created_by` string, uuid — The ID of the user who created the feature flag.
      - `description` string, required — The description of the feature flag.
      - `distribution_channel` string — Distribution channel for the feature flag.
      - `feature_flag_environments` FeatureFlagEnvironment[] — Environment-specific settings for the feature flag.
        - `allocations` object, nullable — Allocation metadata for this environment.
        - `default_allocation_key` string — The allocation key used for the default variant.
        - `default_variant_id` string, nullable — The ID of the default variant for this environment.
        - `environment_id` string, uuid, required — The ID of the environment.
        - `environment_name` string — The name of the environment.
        - `environment_queries` string[] — Queries that target this environment.
        - `is_production` boolean — Indicates whether the environment is production.
        - `override_allocation_key` string — The allocation key used for the override variant.
        - `override_variant_id` string, nullable — The ID of the override variant for this environment.
        - `pending_suggestion_id` string, nullable — Pending suggestion identifier, if approval is required.
        - `require_feature_flag_approval` boolean — Indicates whether feature flag changes require approval in this environment.
        - `status` 'ENABLED' | 'DISABLED', required — The status of a feature flag in an environment.
      - `json_schema` string, nullable — JSON schema for validation when value_type is JSON.
      - `key` string, required — The unique key of the feature flag.
      - `last_updated_by` string, uuid — The ID of the user who last updated the feature flag.
      - `name` string, required — The name of the feature flag.
      - `require_approval` boolean — Indicates whether this feature flag requires approval for changes.
      - `staleness_status` string — Indicates the whether a feature flag is stale or not.
      - `tags` string[] — Tags associated with the feature flag.
      - `updated_at` string, date-time — The timestamp when the feature flag was last updated.
      - `value_type` 'BOOLEAN' | 'INTEGER' | 'NUMERIC' | 'STRING' | 'JSON', required — The type of values for the feature flag variants.
      - `variants` Variant[], required — The variants of the feature flag.
        - `created_at` string, date-time — The timestamp when the variant was created.
        - `id` string, uuid, required — The unique identifier of the variant.
        - `key` string, required — The unique key of the variant.
        - `name` string, required — The name of the variant.
        - `updated_at` string, date-time — The timestamp when the variant was last updated.
        - `value` string, required — The value of the variant as a string.
    - `id` string, uuid, required — The unique identifier of the feature flag.
    - `type` 'feature-flags', required — The resource type.

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found
- `429` — Too many requests

---

[API](https://skmtc.net/datadog/apis/api-v2.md) · [All operations](https://skmtc.net/datadog/apis/api-v2/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/datadog/api-v2/revisions/da68bf029e4c/schema)
