# MongoDB v1 API

The MongoDB v1 API lets you manage MongoDB database clusters programmatically by using the conventional `HTTPS` requests. The creation of MongoDB cluster functionality that is available in the <code class="expression">space.vars.ionos\_cloud</code> DCD is also available through the API.

## What can you do with the MongoDB v1 API?

Use the MongoDB v1 API to:

* Create and configure a MongoDB replica set and sharded clusters.
* Manage database users and access controls.
* Enable the BI Connector for analytics.
* Migrate data between clusters.
* Restore databases from backups.
* Access cluster logs for monitoring and troubleshooting.

## MongoDB v1 OpenAPI Specification

**Endpoint:** `https://api.ionos.com/databases/mongodb`

To make authenticated requests to the API, you need to include a few fields in the request headers. The following are the relevant request parameters and descriptions:

### Request parameter headers

| Header                | Required |   Type  | Description                                                                                                                       |
| --------------------- | :------: | :-----: | --------------------------------------------------------------------------------------------------------------------------------- |
| **Authorization**     |    yes   |  string | HTTP Basic authorization. A base64 encoded string of a username and password separated by a colon. `username@domain.tld:password` |
| **X-Contract-Number** |    no    | integer | Users with more than one contract may apply this header to indicate which contract it applies to.                                 |
| **Content-Type**      |    yes   |  string | Set this to `application/json`.                                                                                                   |

### Examples

We use `curl` in our examples because it is available on Windows 10, Linux and macOS. If you encounter any problems with `curl` on Linux or Windows, refer to the following:

## Quick Links

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Create a MongoDB Cluster</strong></mark></td><td>Learn how to create a MongoDB cluster.</td><td><a href="/pages/2I0bZted0KQH06tPMCYw">/pages/2I0bZted0KQH06tPMCYw</a></td></tr><tr><td><mark style="color:blue;"><strong>Create a Sharded Database Cluster</strong></mark></td><td>Learn how to create a MongoDB sharded cluster.</td><td><a href="/pages/UvCcWWuvoeJB9NDkAplq">/pages/UvCcWWuvoeJB9NDkAplq</a></td></tr><tr><td><mark style="color:blue;"><strong>Modify Cluster Attributes</strong></mark></td><td>Learn how to modify a MongoDB cluster attributes.</td><td><a href="/pages/mueVNsL8F2JpkOKmXrIo">/pages/mueVNsL8F2JpkOKmXrIo</a></td></tr><tr><td><mark style="color:blue;"><strong>Enable the BI Connector</strong></mark></td><td>Learn how to enable the BI Connector.</td><td><a href="/pages/RYRvRDehu3K8dBzKfrjp">/pages/RYRvRDehu3K8dBzKfrjp</a></td></tr><tr><td><mark style="color:blue;"><strong>Users Management</strong></mark></td><td>Learn how to create, view, and delete users using MongoDB clusters.</td><td><a href="/pages/ewYahT7p7IktJLw95tQx">/pages/ewYahT7p7IktJLw95tQx</a></td></tr><tr><td><mark style="color:blue;"><strong>Access Logs</strong></mark></td><td>Learn how to access the logs via the API.</td><td><a href="/pages/WuIZLl4pEOsW9A7caorY">/pages/WuIZLl4pEOsW9A7caorY</a></td></tr><tr><td><mark style="color:blue;"><strong>Database Migration</strong></mark></td><td>Learn how to migrate your MongoDB data from one cluster to another one.</td><td><a href="/pages/Bm1tMySAnFrwEQpE5DMp">/pages/Bm1tMySAnFrwEQpE5DMp</a></td></tr><tr><td><mark style="color:blue;"><strong>Restore a Database</strong></mark></td><td>Learn how to restore a database cluster.</td><td><a href="/pages/HwQbi3Shym0KbEEfaldl">/pages/HwQbi3Shym0KbEEfaldl</a></td></tr><tr><td><mark style="color:blue;"><strong>Connect from Kubernetes</strong></mark></td><td>Learn how to connect to a MongoDB cluster from your managed Kubernetes cluster.</td><td><a href="/pages/yNfu36pJkkDkJmv4xkk9">/pages/yNfu36pJkkDkJmv4xkk9</a></td></tr><tr><td><mark style="color:blue;"><strong>Connect to a MongoDB Instance</strong></mark></td><td>Learn how to connect to a MongoDB instance with the MongoDB Shell `mongosh`.</td><td><a href="/pages/4NV5qMXJjXqSCj7wzu4u">/pages/4NV5qMXJjXqSCj7wzu4u</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ionos.com/cloud/databases/mongodb/api/v1-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
