---
title: "Merge backstop sweep (POST)"
method: POST
path: "/cron/merge-backstop"
tags: ["Cron"]
---

# Merge backstop sweep (POST)

`POST /cron/merge-backstop`

## Request

- Base URL: `https://api.apphandoff.com/api`
- URL: `https://api.apphandoff.com/api/cron/merge-backstop`
- Auth: none required

Scheduled hourly as the `merge-backstop` stage of the Slipstream `hourly-sweeps`
schedule (`scripts/cron-merge-backstop.sh`, which pages on `nextCursor`). The
pg_cron job `merge-backstop` (supabase/migrations/20261016030000_chore_cron_jobs.sql,
scheduled inactive until HO-18167) posts `?pages=2`, running both pages in one
request. Same parameters as GET.

## Query parameters

- `dry_run` '1'
- `catch_up` '1'
- `before` string, date-time
- `pages` integer

## Response `200`

Backstop run result

- CronMergeBackstopResult
  - `ok` boolean, required
  - `dryRun` boolean, required
  - `catchUp` boolean, required
  - `pages` integer: Ticket-sweep pages this request ran (HO-18165); at most the `pages` asked for.
  - `truncated` boolean, required: True when the LAST ticket-sweep page stopped before every candidate was seen (full page or deadline).
  - `nextCursor` string, nullable, required: The last page's cursor; pass back as `before` to continue paging; null when nothing remains.
  - `earlierSweeps` object[]: The sweepUnmergedTickets counters of every page BEFORE the last, in order (the last page is `sweep`); empty for a one-page request; a null entry is a page that threw.
  - `repair` object: repairMergedRolesWhereMergedAtSet counters.
  - `sweep` object, nullable: The last page's sweepUnmergedTickets counters; null when that page threw.
  - `prSweep` object, nullable: sweepRecentGithubPrs counters; null when that sweep threw.

## Other responses

- `400`: Malformed `before` cursor (INVALID_CURSOR) or `pages` outside 1..2 (INVALID_PAGES)
- `401`: Missing or invalid CRON_SECRET

---

[API](https://skmtc.dev/apphandoff/apis/apphandoff-api.md) · [All operations](https://skmtc.dev/apphandoff/apis/apphandoff-api/llms.txt) · [OpenAPI document](https://skmtc.dev/apphandoff/apis/apphandoff-api/revisions/9f138fe46d56?raw)
