# DELETE /databases/users/{name}/grants/{database}

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the databases group.

Revoke a database user's grant on a database

- Who may call it: administrator, reseller, customer
- Token scope, any of: databases, all
- Answers: 200 OK

Use 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.

UrbeStack removes the grant and resets the password and remaining 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.

The API returns 400 if name or database falls 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.

## As a command

- [urbestack-database-grant-set](https://urbestack.com/docs/commands/urbestack-database-grant-set.md): Sets a database user's privileges on a named database.

## Parameters

- `name` (path, DatabaseName, required)
- `database` (path, DatabaseName, required)

## Example

Set $API to the base URL and $TOKEN to the token, as the [API overview](https://urbestack.com/docs/api.md) shows.

```
curl -sS -X DELETE "$API/databases/users/alice/grants/alice_shop" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 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

- 400: --name, --database and --level are required
- 400: <db.name> is <db.user>'s and <name> is <user>'s: a user is granted only databases of the same customer
- 400: A <what> name is 1 to 64 letters, digits or underscores
- 400: A custom grant needs a privilege list of names separated by commas: SELECT, INSERT, ...
- 400: The level is full, read-only or custom
- 401: Authentication required
- 404: No such database user: 
- 404: No such database: 
