---
title: "Update Subscription Admin"
method: PATCH
path: "/v1/admin_console/subscription/{subscription_id}"
tags: ["admin_console", "subscription"]
---

# Update Subscription Admin

`PATCH /v1/admin_console/subscription/{subscription_id}`

## 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/{subscription_id}`
- Auth: HTTP bearer

Inline-edit a subscription's status/ends_at from the admin tool.

Admin role only — VIEWERs are rejected with 403 by `require_admin`.
Emits a structured Axiom log line on success (D6 audit policy).

## Path parameters

- `subscription_id` integer, required

## Request body

- AdminUpdateSubscriptionPayload: Patch payload for admin inline-edit on the subscription tables. Mirrors the Appsmith `update_subscription`, `update_inactive_subscription`, `update_manual_subscription` queries — all three set status + ends_at. `expected_updated_at` is the timestamp the client most recently saw on this row. If the row in the DB has moved since, the request is rejected with 409 Conflict — prevents two admins silently overwriting each other. Optional so callers (cron, scripts) can opt out.
  - `status` 'on_trial' | 'active' | 'paused' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'created'
  - `ends_at` string, date-time, nullable
  - `product_name` 'Pro' | 'Pro+'
  - `expected_updated_at` string, date-time, nullable

## Response `200`

Successful Response

- AdminUpdateSubscriptionResponse
  - `id` integer, required
  - `status` 'on_trial' | 'active' | 'paused' | 'past_due' | 'unpaid' | 'cancelled' | 'expired' | 'created', required
  - `ends_at` string, date-time, nullable
  - `product_name` 'Pro' | 'Pro+', required
  - `updated_at` string, date-time, 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)
