---
title: "Fork Cluster to New Cluster"
method: POST
path: "/postgres/{postgres_cluster_id}/fork"
tags: ["Postgres Clusters"]
---

# Fork Cluster to New Cluster

`POST /postgres/{postgres_cluster_id}/fork`

Fork a ready Managed Postgres cluster into a new cluster that inherits the source's settings. The source cluster is left unchanged, and the fork is provisioned asynchronously.

## Path parameters

- `postgres_cluster_id` string, required

## Request body

- ForkPostgresClusterRequest
  - `name` string — Name for the forked cluster. Defaults to the source name with a -fork suffix.

## Response `201`

New cluster provisioned from the fork

- ShowPostgresClusterResponse
  - `data` PostgresCluster
    - `attached_apps` PostgresAttachedApp[] — Apps attached to the cluster.
      - `name` string — Attached Fly app name.
    - `cpu_kind` 'shared' | 'performance' — CPU class.
    - `cpus` integer — vCPUs per node.
    - `created_at` string — RFC 3339 creation timestamp.
    - `disk_size_gb` integer — Disk size in gigabytes.
    - `endpoints` PostgresClusterEndpoints
      - `primary` PostgresNodeEndpoints
        - `direct` PostgresEndpoint
          - `host` string — Hostname to connect to.
          - `port` integer — TCP port.
        - `pooler` PostgresEndpoint
          - `host` string — Hostname to connect to.
          - `port` integer — TCP port.
    - `id` string — Cluster ID.
    - `memory_mb` integer — Memory per node in megabytes.
    - `name` string — Cluster name.
    - `organization` OrganizationRef
      - `name` string — Organization name.
      - `slug` string — Organization slug.
    - `pg_major_version` '16' | '17' — Postgres major version.
    - `plan` 'basic' | 'starter' | 'launch' | 'scale' | 'Performance' — Plan slug.
    - `postgis_enabled` boolean — Whether PostGIS support is enabled.
    - `region` string — Fly region code.
    - `replicas` integer — Number of replicas.
    - `status` 'creating' | 'initializing' | 'ready' | 'deleting' | 'deleted' | 'failed' — Current lifecycle status.

## Other responses

- `400` — Fork failed
- `404` — Cluster not found
- `409` — The source cluster is not ready to be forked yet
- `410` — 'This cluster has been deleted' or 'This cluster is being deleted'
- `422` — Invalid attributes

---

[API](https://skmtc.net/machines/apis/machines-api.md) · [All operations](https://skmtc.net/machines/apis/machines-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/machines/machines-api/versions/633ddedda749/schema)
