---
title: "Record which flags a running app actually evaluated."
method: POST
path: "/flags/exposure"
tags: ["Feature Flags"]
---

# Record which flags a running app actually evaluated.

`POST /flags/exposure`

## Request

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

This is what makes `last_evaluated_at` mean something. The snapshot
endpoint hands the SDK every flag in the environment and evaluation then
happens locally, so the control plane cannot otherwise tell a flag that is
referenced by live code from one nothing has called in a year. Stamping on
snapshot fetch would mark every flag as freshly used and defeat the point.

Scope comes from the deployment token, never the body. The endpoint writes
only `last_evaluated_at` — never a flag's value — so "a deployment token
cannot change what a flag serves" still holds despite this being a write.

## Request body

- RecordExposureRequest: Keys a running app actually evaluated since its last report.
  - `keys` string[], required: Flag keys evaluated since the last report. Unknown keys are ignored.

## Response `200`

Exposure recorded

- RecordExposureResponse
  - `recorded` integer, required: How many keys were accepted for processing. Deliberately not the number of rows updated: echoing that back would let a caller post a single candidate key and read the result as "this flag exists", turning the endpoint into an existence oracle.

## Other responses

- `400`: Deployment token required
- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-08-04** `c647b6ab1d2c`: 1 info
  - endpoint added

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