# PostgreSQL v1 API

The PostgreSQL cluster functionality available in the <code class="expression">space.vars.ionos\_cloud</code> DCD is also available through the API.

The PostgreSQL v1 API refers to the existing API and works alongside the PostgreSQL v2 API.

{% hint style="warning" %}
**Important:** The **PostgreSQL v1** API will be deprecated in an upcoming release. All existing clusters operating on the v1 version will be automatically migrated to the v2 version as part of this process. No user action is required. For more information, see [<mark style="color:blue;">Version comparison</mark>](/cloud/databases/postgresql/api/v1-v2-api-versions.md#version-comparison).
{% endhint %}

## What Can You Do with the PostgreSQL v1 API?

Use the PostgreSQL v1 API to:

* Create and manage PostgreSQL database clusters.
* Manage database users and access controls.
* Filter and paginate by cluster name.
* Handle backups and restores.
* Access cluster logs for monitoring and troubleshooting.

## PostgreSQL v1 OpenAPI specification

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

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 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>Set Up a PostgreSQL Cluster</strong></mark></td><td>Learn how to set up a PostgreSQL cluster using the API.</td><td><a href="/pages/8c7Dr9YT4PgIHHkgEXDs">/pages/8c7Dr9YT4PgIHHkgEXDs</a></td></tr><tr><td><mark style="color:blue;"><strong>Modify Cluster Attributes</strong></mark></td><td>Learn how to modify attributes of an existing PostgreSQL cluster.</td><td><a href="/pages/u0owxuCAPFcurF9faF94">/pages/u0owxuCAPFcurF9faF94</a></td></tr><tr><td><mark style="color:blue;"><strong>Manage Users and Databases</strong></mark></td><td>Learn how to manage users and database clusters of PostgreSQL.</td><td><a href="/pages/BOECyzQDjmmBQ1tcAvUG">/pages/BOECyzQDjmmBQ1tcAvUG</a></td></tr><tr><td><mark style="color:blue;"><strong>Connect from Kubernetes</strong></mark></td><td>Learn how to connect to a database from your managed Kubernetes cluster.</td><td><a href="/pages/UFsptH0eT65as2VrWESI">/pages/UFsptH0eT65as2VrWESI</a></td></tr><tr><td><mark style="color:blue;"><strong>View Cluster Metrics</strong></mark></td><td>Learn how to view metrics for your PostgreSQL cluster.</td><td><a href="/pages/UvzX7m4Bz0X1YaGjwHGF">/pages/UvzX7m4Bz0X1YaGjwHGF</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/postgresql/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.
