# Restore Backup or Point in Time to New Cluster (/postgres-clusters/Postgres_restore)

Restore a backup, or a point in time within the cluster's PITR recovery window, into a new Managed Postgres cluster. The source cluster is left unchanged, and a new cluster is provisioned asynchronously.

`POST /v1/postgres/{postgres_cluster_id}/restore`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `postgres_cluster_id` | path | `string` | Yes | Managed Postgres Cluster ID |

## Request Body

Type: `restorePostgresClusterRequest`

| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `backup_id` | `string` | No | Backup label to restore from, as returned by the backups list. Mutually exclusive with pitr_time. |
| `name` | `string` | No | Name for the restored cluster. Defaults to a generated name derived from the source cluster and backup/point in time when omitted or blank. |
| `pitr_time` | `string` | No | Point in time to restore to, as an RFC3339 timestamp with an explicit offset from UTC (e.g. Z or +02:00). Normalized to UTC and must fall within the cluster's PITR recovery window. Mutually exclusive with backup_id. |

## Responses

| Status | Description | Schema |
| --- | --- | --- |
| `201` | New cluster provisioned from the backup or point in time | `showPostgresClusterResponse` |
| `400` | Restore failed | `PostgresErrorResponse` |
| `404` | 'Cluster not found' for the cluster; 'Backup <backup_id> not found for cluster <postgres_cluster_id>' for the backup | `PostgresErrorResponse` |
| `422` | A restore target is missing, both backup_id and pitr_time were supplied, point-in-time restore is outside the recovery window or unavailable, or name is invalid | `PostgresErrorResponse` |

The full machine-readable OpenAPI spec is available at /openapi.json.