/databases/users/{name}/grants/{database}
0.1.0Unchanged since publicationSet a database user's privileges on a database
databasesallUse the exact database name. The database and the database user must belong to the same customer, and the caller must be allowed to act for that customer. MariaDB must be installed and database.enabled must be on.
Set level to full for ALL PRIVILEGES on the database, read-only for SELECT and SHOW VIEW, or custom to supply privileges such as SELECT, INSERT. The API returns 400 for an invalid level, a missing or incorrectly formatted custom privilege list, or a name or database value outside the allowed format of 1 to 64 ASCII letters, digits, or underscores. A database user outside the caller's permitted accounts is reported as not found.
UrbeStack resets the password and grants on every MariaDB account for the database user to the recorded values, including accounts for additional hosts. The response returns the updated database user in user.
As a command
Run as root on the serverParameters
namepath ·DatabaseNameRequireddatabasepath ·DatabaseNameRequiredRequest body
JSON· 2 fieldslevelstring, one of full, read-only, customRequiredprivilegesstringExample
See the API overview for how to set $API and $TOKEN.curl -sS -X PUT "$API/databases/users/alice/grants/alice_shop" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"level": "full",
"privileges": "text"
}'200 OK{
"user": {
"created_at": "2026-09-09T10:15:00Z",
"grants": [
{
"database": "alice_shop",
"level": "full",
"privileges": "text"
}
],
"id": 1,
"name": "alice",
"other_hosts": [
"text"
],
"updated_at": "text",
"user": "alice",
"user_id": 2
}
}Errors
8 errors, each a status and a sentence400--name, --database and --level are required400<db.name> is <db.user>'s and <name> is <user>'s: a user is granted only databases of the same customer400A <what> name is 1 to 64 letters, digits or underscores400A custom grant needs a privilege list of names separated by commas: SELECT, INSERT, ...400The level is full, read-only or custom401Authentication required404No such database user: 404No such database: urbestack.com/docs/api/put-databases-users-name-grants-database/