---
title: "Create Replication"
method: POST
path: "/api/v1/databases/replication-groups"
tags: ["databases"]
---

# Create Replication

`POST /api/v1/databases/replication-groups`

## Request

- Base URL: `https://api.mengi.cloud` (the document declares no server; this is the origin it was published from)
- URL: `https://api.mengi.cloud/api/v1/databases/replication-groups`
- Auth: none declared

Create a replication group spanning multiple clusters.

The first cluster becomes the primary (read-write). Remaining clusters
become replicas that are provisioned after the primary is running.

## Request body

- ReplicationGroupCreate
  - `name` string, required
  - `engine` 'postgresql' | 'mysql', required
  - `cluster_ids` string[], required
  - `database_config` DatabaseCreate, required
    - `cluster_id` string, uuid, required
    - `name` string, required
    - `engine` 'postgresql' | 'mysql', required
    - `engine_version` string, required
    - `tier` 'single' | 'ha' | 'replicated'
    - `cpu_request` number, nullable
    - `memory_request_mb` integer, nullable
    - `storage_size_gb` integer
    - `database_name` string
    - `max_connections` integer, nullable
    - `extensions` string[], nullable
    - `backup_enabled` boolean
    - `backup_schedule` string, nullable
    - `backup_retention_days` integer, nullable
    - `external_access` boolean
    - `restore_from_database_id` string, uuid, nullable

## Response `201`

Successful Response

- ReplicationGroupResponse
  - `id` string, uuid, required
  - `name` string, required
  - `engine` 'postgresql' | 'mysql', required
  - `primary_instance_id` string, uuid, nullable
  - `instances` DatabaseResponse[], required
    - `id` string, uuid, required
    - `user_id` string, uuid, required
    - `organization_id` string, uuid, nullable
    - `cluster_id` string, uuid, required
    - `name` string, required
    - `engine` 'postgresql' | 'mysql', required
    - `engine_version` string, required
    - `tier` 'single' | 'ha' | 'replicated', required
    - `status` 'pending' | 'provisioning' | 'running' | 'degraded' | 'upgrading' | 'error' | 'deleting' | 'restoring', required
    - `cpu_request` number, nullable
    - `memory_request_mb` integer, nullable
    - `storage_size_gb` integer, required
    - `replicas` integer, required
    - `database_name` string, required
    - `max_connections` integer, nullable
    - `extensions` string[], nullable
    - `external_access` boolean
    - `external_host` string, nullable
    - `connection_host` string, nullable
    - `connection_port` integer, nullable
    - `connection_secret_name` string, nullable
    - `backup_enabled` boolean, required
    - `backup_schedule` string, nullable
    - `backup_retention_days` integer, nullable
    - `git_path` string, nullable
    - `argocd_app_name` string, nullable
    - `replication_group_id` string, uuid, nullable
    - `replication_role` string, nullable
    - `replication_source_id` string, uuid, nullable
    - `replication_host` string, nullable
    - `replication_lag_bytes` integer, nullable
    - `replication_status` string, nullable
    - `error_message` string, nullable
    - `fee_exempt_until` string, date-time, nullable
    - `created_at` string, date-time, required
    - `updated_at` string, date-time, required
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/mengi/apis/mengi-cloud.md) · [All operations](https://skmtc.dev/mengi/apis/mengi-cloud/llms.txt) · [OpenAPI document](https://skmtc.dev/mengi/apis/mengi-cloud/revisions/4ae9b375cdbb?raw)
