---
search:
  tags:
    - database-services
    - POST
seo:
  description: >-
    Rolls the service back to the… Reference for the POST
    /api/v1/database-services/{id}/major-upgrade/rollback endpoint in the
    TimescaleDB Enterprise API.
  noindex: true
sidebar:
  label: Roll back a major upgrade
  badge: POST
title: Roll back a major upgrade
type: openapi-operation
---
Rolls the service back to the earlier PostgreSQL major after a major upgrade in Copy mode (ADR 2026-10-22 D8), until Cleanup. Every write since the start of the new major is lost, and each change of the service configuration since then. The backups of the new major stay in the repository until they expire; a fork from the newest one keeps the writes. The console stops the new major on each server, puts back patroni.yml and the stanza files of the earlier major, runs stanza-upgrade with its paths, removes the cluster key from the DCS, and starts the earlier major on the server that led the window, which becomes the leader. Then the licence grant of the old cluster comes back (an air-gapped console waits for the grant in a bundle on POST /license/bundle first), pgaudit is made again, the clients start, the files of the new major go, the replicas that kept their data directory of the earlier major start, and a full backup and the rebuild of the other replicas follow. The workflow is upgrade_major_rollback. A rollback that stopped after its point of no return continues on a new call. 409 after a Link or Swap upgrade, after Cleanup, when the server that led the window left the service, when the pin moved, or when another action runs. The workflow fails before any change when that server has no data directory of the earlier major in the state "shut down".

`POST /api/v1/database-services/{id}/major-upgrade/rollback`

**Responses**

- `202` — Accepted
- `default` — Error

Response example, 202:

```json
{
  "workflow_id": "string"
}
```
