Managing users and databases
Users (i.e. roles with LOGIN privileges) and databases can be created using the documented SQL commands. The API provides an alternative way to manage these objects.
Common attributes
Each response from the API will include some standard attributes for metadata and pagination (for collections) which follow the IONOS API standards. Most of these will be omitted from the response examples for brevity.
Type, ID and Pagination in collections
{
"_links": {
"next": "https://link-to-next-collection-page",
"previous": "https://link-to-previous-collection-page",
"self": "https://link-to-this-collection-page"
},
"href": "http://link-to-this-collection-page",
"id": "UUID-for-this-collection-page",
"items": [
...
],
"limit": 100,
"offset": 0,
"type": "collection"
}Type, ID and Metadata for resources
If a resource is:
not created via the API, its
createdByfield ends with_unmanaged_.a read-only system resource, its
createdByfield ends with_system_.
Managing users
The endpoint for user management of a postgresql cluster is /users.
List all users
A GET request will give you a list of all users. Use the limit and offset parameters to control pagination.
Response
List system users
Set the system parameter to true to view system users too. These users are required for administration purposes and cannot be changed or deleted.
Response
Retrieve a single user
A single user can be retrieved by their name using a GET request.
Response
Create a user
With the POST request, you can create a new user and set the login password.
Response
The created user is returned.
Remove a user
Use a DELETE request to remove a user. System users cannot be deleted.
Response
The response body is empty.
Change the login password
With the PATCH request, you can change the login password.
Response
The updated user is returned. The password is never returned, though.
Managing databases
The endpoint for database management of a postgresql cluster is /databases.
List all databases
A GET request will give you a list of all databases. Use the limit and offset parameters to control pagination.
Response
Retrieve a single database
A single database can be retrieved by its name using a GET request.
Response
Create a database
Use a POST request to create a new database. It must specify both the name and the owner.
Response
The created database is returned.
Remove a database
Use a DELETE request to remove a database.
Response
The response body is empty.
Last updated
Was this helpful?