---
title: "Evaluate every client-visible flag for the visitor making the request."
method: POST
path: "/_temps/flags"
tags: ["Feature Flags"]
---

# Evaluate every client-visible flag for the visitor making the request.

`POST /_temps/flags`

## Request

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

Unauthenticated: the project and environment come from the `Host` the
browser called, never from the body. Only flags marked `client_visible`
are evaluated or mentioned; a server-only flag is indistinguishable from
one that does not exist.

## Request body

- PublicFlagsRequest: Body of `POST /api/_temps/flags`. Every field is optional; an empty body evaluates every client-visible flag for the visitor the request carries.
  - `attributes` object: Targeting attributes. Override the implicit ones of the same name.
  - `key` string, nullable: Bucketing subject, e.g. a signed-in user id. Defaults to the Temps visitor cookie when the request carries one.
  - `keys` string[], nullable: Evaluate only these flags. Omit for all client-visible flags.

## Response `200`

Evaluated client-visible flags

- PublicFlagsResponse
  - `flags` PublicFlagEvaluation[], required
    - `key` string, required
    - `reason` union, required: Why an evaluation produced the value it did. Part of the wire contract, and the only thing that makes "why is this user seeing the old checkout?" answerable.
      - object: No such flag, or it has been archived. The caller's fallback is served.
        - `kind` 'FLAG_NOT_FOUND', required
      - object: Kill switch engaged for this environment.
        - `kind` 'DISABLED', required
      - object: Targeting rule `index` (0-based) matched on its conditions alone.
        - `index` integer, required
        - `kind` 'RULE_MATCH', required
      - object: Targeting rule `index` matched and the subject's bucket decided the outcome: it was inside the rule's rollout percentage, or the rule split subjects across variants.
        - `index` integer, required
        - `kind` 'PERCENTAGE_ROLLOUT', required
      - object: An environment-specific value was set.
        - `kind` 'ENVIRONMENT_VALUE', required
      - object: Nothing more specific applied; the flag default was served.
        - `kind` 'DEFAULT', required
      - object: Evaluation degraded (malformed stored value or rule). The default is served and the caller is told the value is not trustworthy. Never panics.
        - `kind` 'ERROR', required
    - `record_exposure` boolean, required: Whether the app should record a `flag_exposure` analytics event when it reads this flag. Decided here, per subject, from the flag's exposure sample rate, so sampling is stable for a visitor and costs the browser nothing.
    - `value` unknown, required
    - `variant` string, nullable

## Other responses

- `400`: Malformed or oversized context
- `404`: No environment serves this host
- `429`: Rate limit exceeded
- `503`: Flags could not be loaded

## Changes

- **2026-11-20** `68c970dc603c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/_temps/flags/post.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)
