---
title: "Backfill Cancelled At"
method: POST
path: "/v1/admin_console/subscription/backfill_cancelled_at"
tags: ["admin_console", "subscription"]
---

# Backfill Cancelled At

`POST /v1/admin_console/subscription/backfill_cancelled_at`

## Request

- Base URL: `https://api.linktodm.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.linktodm.com/v1/admin_console/subscription/backfill_cancelled_at`
- Auth: HTTP bearer

TEMPORARY: one-off backfill of `cancelled_at` (when the subscription
left Active) for existing non-active subscriptions, sourced live from
Razorpay / Lemon Squeezy. Admin role only; safe to re-run. Remove after
the backfill has run in every environment.

## Query parameters

- `overwrite` boolean: Refresh every non-active row, not just those with a NULL cancelled_at.

## Response `200`

Successful Response

- AdminBackfillCancelledAtResponse: Result of the one-off cancelled_at backfill. TEMPORARY endpoint — remove once existing non-active rows have been backfilled. `cancelled_at` records when the subscription left the Active status; the date is pulled live from the payment provider (Razorpay / Lemon Squeezy), not from our own tables. - `updated`: rows that got a cancelled_at this run. - `failed`: rows we could not resolve (provider fetch error, no provider subscription id, or no past timestamp in the provider payload) — left untouched. - `remaining`: non-active rows still holding a NULL cancelled_at.
  - `updated` integer, required
  - `failed` integer, required
  - `remaining` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/linktodm/apis/salesmorph.md) - [All operations](https://skmtc.dev/linktodm/apis/salesmorph/llms.txt) - [OpenAPI document](https://skmtc.dev/linktodm/apis/salesmorph/revisions/4af0ad5dbe92?raw)
