---
title: "Every flag for the caller's environment, collapsed to what the evaluator needs."
method: GET
path: "/flags/snapshot"
tags: ["Feature Flags"]
---

# Every flag for the caller's environment, collapsed to what the evaluator needs.

`GET /flags/snapshot`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/flags/snapshot`
- Auth: HTTP bearer

Scope comes from the deployment token, never from the URL: a container's
baked-in `TEMPS_API_TOKEN` identifies exactly one project (and usually one
environment), so a compromised app cannot read another tenant's flags by
changing a path parameter.

Supports `If-None-Match`, so the SDK's background poll is a 304 in the
common case.

## Query parameters

- `environment_id` integer, nullable

## Response `200`

Snapshot for the environment

- FlagSnapshotResponse
  - `environment_id` integer, required
  - `flags` FlagSnapshot[], required: Flags collapsed to what the evaluator needs, sorted by key so the serialized form — and therefore the ETag — is stable.
    - `default_value` unknown, required
    - `enabled` boolean, required: False means the kill switch is engaged for this environment.
    - `environment_value` unknown
    - `key` string, required
    - `rules` FlagRule[]: Ordered targeting rules for this environment. First match wins.
      - `conditions` RuleCondition[]: All must hold. Empty means every subject.
        - `attribute` string, required: Context attribute name, e.g. `plan`, `country`, `email`.
        - `operator` 'eq' | 'neq' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'matches' | 'gt' | 'gte' | 'lt' | 'lte' | 'exists' | 'not_exists', required: Comparison applied by one rule condition.
        - `value` union: The right-hand side of a condition: one value, or a list for `in`/`not_in`.
          - AttributeValue[]
            - union: A targeting attribute: what the caller (or the server, implicitly) knows about the subject.
              - …
          - union: A targeting attribute: what the caller (or the server, implicitly) knows about the subject.
            - boolean
            - number, double
            - string
      - `description` string, nullable: Free text shown in the console, e.g. "Beta customers".
      - `rollout_percentage` number, double, nullable: Share of matching subjects the rule applies to, `0..=100`. `None` means all of them. Ramping it up never removes anyone already included.
      - `serve` union, required: What a matching rule serves.
        - object: A literal value of the flag's type.
          - `kind` 'value', required
          - `value` unknown, required
        - object: One declared variant.
          - `kind` 'variant', required
          - `variant` string, required
        - object: Subjects split across declared variants by weight, stably per subject.
          - `kind` 'split', required
          - `split` VariantWeight[], required
            - `variant` string, required: A variant key declared on the flag.
            - `weight` integer, required: Share of the rule's subjects, in whole percent. A split's weights sum to 100.
    - `salt` string: Bucketing salt. Needed by an SDK that evaluates rollouts locally.
    - `value_type` 'bool' | 'string' | 'number' | 'json', required: The declared type of a flag's value. Fixed at create time.
    - `variants` FlagVariant[]: Named values rules may serve.
      - `description` string, nullable
      - `key` string, required: `[a-z0-9][a-z0-9._-]*`, unique within the flag.
      - `value` unknown, required

## Other responses

- `304`: Snapshot unchanged
- `400`: Environment could not be determined
- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-11-20** `68c970dc603c`: 3 info
  - added the optional property `flags/items/rules` to the response with the `200` status
  - added the optional property `flags/items/salt` to the response with the `200` status
  - added the optional property `flags/items/variants` to the response with the `200` status
- **2026-08-04** `c647b6ab1d2c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/flags/snapshot/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
