UpCloud

Database Users

Manage logical databases and user accounts for your Managed Database services. Users can be granted specific permissions and access controls.

Logical database and user management is available for MySQL and PostgreSQL services.


GET/1.3/database/{uuid}/databases

List logical databases

Returns a list of logical databases in a Managed Database service. Available for MySQL and PostgreSQL.

Request

GET
/1.3/database/{uuid}/databases
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/databases \
  -u your_username:your_password

POST/1.3/database/{uuid}/databases

Create logical database

Creates a new logical database in a Managed Database service.

Attributes

  • Name
    name
    Type
    string
    Description

    Database name (1-64 chars). Required.

  • Name
    lc_collate
    Type
    string
    Description

    Locale collation. Default: "en_US.UTF-8". PostgreSQL only.

  • Name
    lc_ctype
    Type
    string
    Description

    Locale character type. Default: "en_US.UTF-8". PostgreSQL only.

Request

POST
/1.3/database/{uuid}/databases
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/databases \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "name": "myapp_db"
  }'

DELETE/1.3/database/{uuid}/databases/{db_name}

Delete logical database

Deletes a logical database from a Managed Database service.

Request

DELETE
/1.3/database/{uuid}/databases/{db_name}
curl -X DELETE https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/databases/myapp_db \
  -u your_username:your_password

GET/1.3/database/{uuid}/users

List users

Returns a list of users in a Managed Database service.

Request

GET
/1.3/database/{uuid}/users
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/users \
  -u your_username:your_password

GET/1.3/database/{uuid}/users/{username}

Get user details

Returns details about a specific database user.

Request

GET
/1.3/database/{uuid}/users/{username}
curl -X GET https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/users/app_user \
  -u your_username:your_password

POST/1.3/database/{uuid}/users

Create user

Creates a new user in a Managed Database service.

Attributes

  • Name
    username
    Type
    string
    Description

    Username (1-64 chars). Required.

  • Name
    password
    Type
    string
    Description

    User password. If not provided, one will be generated.

  • Name
    authentication
    Type
    string
    Description

    Authentication method. MySQL: "mysql_native_password" or "caching_sha2_password".

Request

POST
/1.3/database/{uuid}/users
curl -X POST https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/users \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "username": "app_user",
    "password": "SecurePassword123!",
    "authentication": "caching_sha2_password"
  }'

PATCH/1.3/database/{uuid}/users/{username}

Modify user

Modifies a database user's password or authentication method.

Attributes

  • Name
    password
    Type
    string
    Description

    New password for the user.

  • Name
    authentication
    Type
    string
    Description

    Authentication method.

Request

PATCH
/1.3/database/{uuid}/users/{username}
curl -X PATCH https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/users/app_user \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "password": "NewSecurePassword456!"
  }'

PUT/1.3/database/{uuid}/users/{username}/access-control

Modify user access control

Modifies access control settings for a database user. Available for Valkey/Redis.

Attributes

  • Name
    categories
    Type
    array
    Description

    Command categories allowed. Example: ["+@all"].

  • Name
    commands
    Type
    array
    Description

    Specific commands allowed or denied.

  • Name
    keys
    Type
    array
    Description

    Key patterns user can access.

  • Name
    channels
    Type
    array
    Description

    Pub/Sub channels user can access.

Request

PUT
/1.3/database/{uuid}/users/{username}/access-control
curl -X PUT https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/users/app_user/access-control \
  -u your_username:your_password \
  -H "Content-Type: application/json" \
  -d '{
    "categories": ["+@all", "-@dangerous"],
    "commands": ["-FLUSHALL", "-FLUSHDB"],
    "keys": ["app:*", "cache:*"],
    "channels": ["notifications:*"]
  }'

DELETE/1.3/database/{uuid}/users/{username}

Delete user

Deletes a database user. The primary admin user cannot be deleted.

Request

DELETE
/1.3/database/{uuid}/users/{username}
curl -X DELETE https://api.upcloud.com/1.3/database/09a4b9d5-c1f8-4c9f-9e7a-1234567890ab/users/app_user \
  -u your_username:your_password