> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/api-reference/databases/postgresql/databases-1/get-database.md).

# Get database

Retrieves a single database

```json
{"openapi":"3.0.3","info":{"title":"IONOS DBaaS PostgreSQL REST API","version":"1.0.0"},"tags":[{"name":"Databases","description":"Everything about PostgreSQL databases."}],"servers":[{"url":"https://api.ionos.com/databases/postgresql","description":"Production"}],"security":[{"basicAuth":[]},{"tokenAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"You will need to base64 encode the string containing your credentials.\nSeparate your username and password with a colon, i.e.,\nusername:password and send it as 'Authorization' request header. More\ndetails: https://en.wikipedia.org/wiki/Basic_access_authentication.\n"},"tokenAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Please provide header value as 'Bearer <token>' and don't forget to add\n'Bearer' HTTP Authorization Scheme before the token.\n"}},"parameters":{"ClusterIdPath":{"name":"clusterId","in":"path","description":"The unique ID of the cluster.","required":true,"schema":{"type":"string"}},"DatabasenamePath":{"name":"databasename","in":"path","description":"The database name.","required":true,"schema":{"type":"string","minLength":1,"maxLength":63}}},"schemas":{"DatabaseResource":{"type":"object","allOf":[{"$ref":"#/components/schemas/Resource"},{"$ref":"#/components/schemas/ResourceMetadata"},{"$ref":"#/components/schemas/Database"}]},"Resource":{"type":"object","required":["type","id","href"],"properties":{"type":{"$ref":"#/components/schemas/ResourceType"},"id":{"$ref":"#/components/schemas/ResourceId"},"href":{"$ref":"#/components/schemas/ResourceHref"}}},"ResourceType":{"description":"The type of the resource.","type":"string","enum":["collection","cluster","backup","user","database"]},"ResourceId":{"type":"string","description":"The unique ID of the resource."},"ResourceHref":{"type":"string","description":"Absolute URL of the resource."},"ResourceMetadata":{"type":"object","properties":{"metadata":{"$ref":"#/components/schemas/Metadata"}}},"Metadata":{"type":"object","properties":{"createdBy":{"$ref":"#/components/schemas/UserIdentityURN"},"createdByUserId":{"$ref":"#/components/schemas/UserIdentityUUID"},"createdDate":{"$ref":"#/components/schemas/Timestamp"},"lastModifiedBy":{"$ref":"#/components/schemas/UserIdentityURN"},"lastModifiedByUserId":{"$ref":"#/components/schemas/UserIdentityUUID"},"lastModifiedDate":{"$ref":"#/components/schemas/Timestamp"},"resourceURN":{"$ref":"#/components/schemas/ResourceURN"}}},"UserIdentityURN":{"type":"string","description":"The URN of an IAM user."},"UserIdentityUUID":{"type":"string","format":"uuid","description":"The ID of an IAM user."},"Timestamp":{"type":"string","format":"date-time","description":"An ISO 8601 timestamp."},"ResourceURN":{"type":"string","description":"The URN of the resource."},"Database":{"type":"object","required":["properties"],"properties":{"properties":{"$ref":"#/components/schemas/DatabaseProperties"}}},"DatabaseProperties":{"type":"object","required":["name","owner"],"properties":{"name":{"$ref":"#/components/schemas/Databasename"},"owner":{"$ref":"#/components/schemas/Databaseowner"}}},"Databasename":{"type":"string","description":"The databasename of a given database.","minLength":1,"maxLength":63},"Databaseowner":{"type":"string","description":"The name of the role owning a given database.","minLength":1,"maxLength":63},"ErrorResponse":{"properties":{"httpStatus":{"type":"integer","description":"The HTTP status code of the operation."},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ErrorMessage"}}},"type":"object"},"ErrorMessage":{"properties":{"errorCode":{"type":"string","description":"Application internal error code\n"},"message":{"type":"string","description":"A human readable explanation specific to this occurrence of the\nproblem.\n"}},"type":"object"}},"responses":{"ApiError":{"description":"Any erroneous status code: 400 (parse error), 401 (auth error),\n402 (trial access), 403 (insufficient permissions), 404 (not found),\n405 (unsupported HTTP method), 415 (unsupported content type,\n422 (validation error), 429 (request rate limit exceeded),\n500 (server error), 503 (maintenance)\n","headers":{"Content-Type":{"description":"application/problem+json","schema":{"type":"string","default":"application/problem+json"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/clusters/{clusterId}/databases/{databasename}":{"get":{"operationId":"databasesGet","summary":"Get database","description":"Retrieves a single database","tags":["Databases"],"parameters":[{"$ref":"#/components/parameters/ClusterIdPath"},{"$ref":"#/components/parameters/DatabasenamePath"}],"responses":{"200":{"description":"Successful operation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DatabaseResource"}}}},"default":{"$ref":"#/components/responses/ApiError"}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ionos.com/cloud/api-reference/databases/postgresql/databases-1/get-database.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
