Add a user with read-only, read-write or chosen privileges; the password is shown once
Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication
POST
/api/v1/tenants/{tid}/databases/{id}/usersAdd a user with read-only, read-write or chosen privileges; the password is shown once
Authentication: session cookie __Host-panel_session (contract default; see Authentication).
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
tid | path | string | required | |
id | path | string | required | |
X-CSRF-Token | header | string | optional | Required on unsafe requests authenticated by session cookie; API keys do not use it. |
Request body
required
Content type: application/json
namestring optionalOnly when adding; a user keeps its name
accessstring requiredAllowed values:"read""readwrite""custom"privilegesarray<string> optionalOnly with custom. PostgreSQL cannot grant alter, drop or index to a user that does not own the database.
Allowed values:"select""insert""update""delete""create""alter""drop""index""execute""create_view""trigger""references"hostsarray<string> optionalIPv4 addresses or networks (no wider than /16) the user may connect from; empty means this server only (ADR 0067)
- max items 20
Example
{
"name": "string",
"access": "read",
"privileges": [
"select"
],
"hosts": [
"string"
]
}Responses
201 Queued
Content type: application/json
DatabaseUser & object
idstring requiredtenant_idstring requireddatabase_idstring requiredserver_idstring requirednamestring requiredaccessstring requiredAllowed values:"read""readwrite""custom"privilegesarray<string> requiredhostsarray<string> requireddatabasestring requiredenginestring requiredAllowed values:"mariadb""mysql""mssql""postgres""mongodb"job_idstring requirederror_codestring requiredcreated_atstring (date-time) requiredstatusstring requiredAllowed values:"provisioning""active""updating""failed""deleting""delete_failed"passwordstring required
Example
{
"id": "string",
"tenant_id": "string",
"database_id": "string",
"server_id": "string",
"name": "string",
"access": "read",
"privileges": [
"string"
],
"hosts": [
"string"
],
"database": "string",
"engine": "mariadb",
"job_id": "string",
"error_code": "string",
"created_at": "2026-01-01T00:00:00Z",
"status": "provisioning",
"password": "string"
}default Error
Content type: application/json
codestring requiredmessagestring requireddetails_redactedboolean requiredcorrelation_idstring requiredretryableboolean required