# API How-Tos

### Quick Links:

| [**Setup a Cluster (API)**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/api-howtos/create-a-database) | [**Modify Cluster Attributes**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/api-howtos/modify-cluster-attributes) | [**Access Logs**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/api-howtos/access-logs)               |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Database Migration**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/api-howtos/migration)            | [**Restore from Backup**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/api-howtos/restore-a-database)              | [**Activate Extensions**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/overview/activate-extensions) |
| [**View Cluster Metrics**](https://docs.ionos.com/cloud/~/revisions/5wuXj7QmyFwJl8Wh3LBN/managed-services/database-as-a-service/postgresql/api-howtos/metrics)            |                                                                                                                                                                                       |                                                                                                                                                                         |

### DBaaS API - OpenAPI Specification

{% embed url="<https://api.ionos.com/docs/postgresql/v1/>" %}
Click here for the OpenAPI Specification File
{% endembed %}

**Endpoint:** <https://api.ionos.com/docs/postgresql/v1/>

To make authenticated requests to the API, you must include a few fields in the request headers. Please find relevant descriptions below:

### 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 the applicable contract.                                      |
| **Content-Type**      |    yes   |  string | Set this to `application/json`.                                                                                                   |

### **Examples**

We use `curl` in our examples, as this tool is available on Windows 10, Linux and macOS. Please refer to our blogpost about `curl` on Windows if you encounter any problems:

{% embed url="<https://www.ionos.com/digitalguide/server/tools/introduction-to-curl-in-linux>" %}

{% embed url="<https://www.ionos.com/digitalguide/server/tools/introduction-to-curl-in-windows>" %}
