---
title: "Record Deploy Event"
method: POST
path: "/api/system/deploy-events"
tags: ["system"]
---

# Record Deploy Event

`POST /api/system/deploy-events`

## 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/system/deploy-events`
- Auth: none declared

Called by `scripts/promote-to-production.sh` (via
`scripts/lib/record_deploy_event.py`) and by
`tools/rooster_worker/drain.py`'s `deploy_main_to_staging` (its promotion pass was deleted 2026-11-17) -- see each caller's own comment for why the write is
best-effort there (a promotion must never be blocked on this ledger
being reachable). This route itself is a plain gated write: a bad
`environment` is the one thing it refuses.

## Request body

- RecordDeployEventRequest: One deploy attempt, already finished by the time this is called -- see deploy_events_service.record_deploy_event's own docstring for why this is an INSERT with both timestamps already known, never an update-in-place.
  - `sha` string, required
  - `environment` string, required
  - `started_at` string, date-time, required
  - `finished_at` string, date-time, required
  - `ok` boolean, required
  - `rolled_back` boolean
  - `promoted_by` string, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[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)
