---
title: "Record Station Frames"
method: POST
path: "/api/intake/stations/{station_id}/frames"
tags: ["intake"]
---

# Record Station Frames

`POST /api/intake/stations/{station_id}/frames`

## Request

- Base URL: `https://api.pigeonly.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pigeonly.com/api/intake/stations/{station_id}/frames`
- Auth: none declared

The frames a station sends around one event, kept as training and test material (INTAKE-REC-1, server half).

RULE (lead, 2026-11-10, Fable intake plan step 2; owner words "the training and test set"; ruling
docs/01_decisions/rulings/2026-11-10-the-station-records-its-frames.md). The station sends up to 16 frames of one
photo, refusal or correction; each is stored in the recordings bucket and indexed in `intake_station_frames`. WHY: the
reader needs a set of real envelopes, as the station saw them, to be tested and trained against. The browser half that
sends the frames is INTAKE-REC-2 and is not built yet.

The guard is the one `create_capture` uses: a registered intake station (`at_a_station`) and the intake write grant.
Refused with 403 `not_a_station` before anything is read. With the `intake_station_recorder` setting OFF (the default)
the answer is 409 "recorder off" and nothing is stored. A frame over 300 KB is 413, bad base64 is 422, a station id
outside letters, digits, dot, dash and underscore is 422, and no photo bucket is 503; every one of those is refused
before the first byte is written. The photos go to the bucket first and the rows after, in one transaction, so a
failed bucket write leaves no row behind. A retry of the same event stores no row twice (`ON CONFLICT`).
The request id in the log line is minted here, because the body carries none.

## Path parameters

- `station_id` string, required

## Request body

- StationFramesRequest: The body of `POST /api/intake/stations/{station_id}/frames` (INTAKE-REC-1, lead, 2026-11-10). `event_id` names the event the frames belong to (a photo, a refusal or a correction) and is the first half of the row key; a station that retries the same event sends the same id. `event_at_ms` is the event's own time.
  - `event_id` string, uuid, required
  - `event_kind` 'photo' | 'refusal' | 'correction', required
  - `label` string
  - `event_at_ms` integer, required
  - `frames` StationFrame[], required
    - `t_ms` integer, required
    - `jpeg_b64` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

## Changes

- **2026-11-11** `cff602e091fb`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/changes/api/intake/stations/:station_id/frames/post.md)

---

[API](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os.md) - [All operations](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/llms.txt) - [OpenAPI document](https://skmtc.dev/pigeonly/apis/roost-v2-pigeonly-company-os/revisions/14571c4b7007?raw)
