---
title: "Switch MongoDB between standalone and replica set"
method: PATCH
path: "/v2/databases/{databaseID}/switch-mongo-mode"
tags: ["Configuration"]
---

# Switch MongoDB between standalone and replica set

`PATCH /v2/databases/{databaseID}/switch-mongo-mode`

## Request

- Base URL: `https://api.liara.ir`
- URL: `https://api.liara.ir/v2/databases/{databaseID}/switch-mongo-mode`
- Auth: HTTP bearer

Switches a MongoDB database between standalone mode and single-node replica set mode. Team permission: `operate` or `manage`.

## Path parameters

- `databaseID` string, required: 24-character hexadecimal ID.

## Query parameters

- `teamID` string: 24-character hexadecimal ID.

## Response `200`

The mode was switched.

- object
  - `databaseID` string

## Other responses

- `400`: The database ID or `teamID` is invalid, the database isn't MongoDB, or its MongoDB version doesn't support switching.
- `401`: The API token is missing, invalid or expired.
- `403`: With `teamID`: you aren't a member of the team (`team_not_found`), or you don't have the required permission on this database (`no_permission`).
- `404`: The database doesn't exist.

## Changes

> 21 revisions in range; 1 not diffed.

- **2026-11-02** `f6f78c6f05c6`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/liara-cloud/apis/dbaas/changes/v2/databases/:databaseID/switch-mongo-mode/patch.md)

---

[API](https://skmtc.dev/liara-cloud/apis/dbaas.md) - [All operations](https://skmtc.dev/liara-cloud/apis/dbaas/llms.txt) - [OpenAPI document](https://skmtc.dev/liara-cloud/apis/dbaas/revisions/f6f78c6f05c6?raw)
