Managed Databases

Create database user

Changed on

Add a user with read-only or read-write access. The password is returned once in this response; fetch it again later with GET /api/v1/databases/{database_id}/users/{name}/credential.

  • PostgreSQL, MySQL and ClickHouse. Valkey and Kafka return 501.
  • Name: 3 to 31 characters, lowercase letters, digits and _, starting with a letter. Names the engine or Raff use (raffadmin, postgres, root, admin and others, and the prefixes app_ and fnb_) are refused.
  • Up to 20 users per database. A name in use returns 409. The database must be running.
post/api/v1/databases/{database_id}/users

Request

  • Base URL
    https://api.rafftechnologies.com
  • URL
    https://api.rafftechnologies.com/api/v1/databases/{database_id}/users
  • Auth
    API key in header X-API-Key

Path parameters

database_idstring required

Database ID (UUID) or short id (the database_id field, e.g. a1b2c3d4)

Request body

namestring required

3 to 31 characters. Starts with a lowercase letter, then lowercase letters, digits, or underscores. Names starting with app_ or fnb_ are reserved for Raff Apps and Functions.

role'readonly' | 'readwrite' required

Example request

{
  "name": "reporting"
}

Response

User created

successboolean
passwordstring

The new user's password

Example response

{
  "user": {
    "name": "reporting",
    "role": "readonly"
  }
}

Changes