# GET /databases/users

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

UrbeStack release 0.2.35 API operation in the databases group.

List database users and their grants

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

Administrators can list all managed database users. Resellers can list their own database users and their customers' database users. Customers can list their own. The response excludes phpMyAdmin sign-on users and password hashes.

The basic listing returns users and supports the user filter for administrators and resellers. For administrators, q, page, or per_page selects the detailed listing. Using owner alone filters the basic listing and returns more set to false. For resellers and customers, supplying any of q, owner, page, or per_page selects the detailed listing. When MariaDB responds, the detailed listing includes other_hosts, the additional hosts under which each database user has a MariaDB account.

Supply page or per_page to paginate. Omit both to return all matches. The API ignores q values longer than 200 characters or containing ASCII control characters. It ignores page and per_page values outside their accepted decimal formats.

## As a command

- [urbestack-database-user-list](https://urbestack.com/docs/commands/urbestack-database-user-list.md): Lists the database users managed by UrbeStack, with their grants.

## Parameters

- `user` (query, Username): Owner username for the basic listing, available to administrators and resellers within their permitted accounts.
- `q` (query, string, up to 200 characters): Literal search text with surrounding whitespace removed. Matches a case-insensitive substring of the database user's name or of any database name it can access, or the owner's full username.
- `owner` (query, Username): Username of the owner whose database users to list.
- `page` (query, integer, 1 or more): Page number in up to 9 decimal digits. The default is 1, 0 selects the first page, and a number beyond the last page selects the last page.
- `per_page` (query, integer, 1 to 1000): Number of database users per page, from 1 to 1000. Defaults to 25 when pagination is requested.

## 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 GET "$API/databases/users?user=alice&q=text&owner=alice&page=1&per_page=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "all": {
    "total": 1
  },
  "more": true,
  "page": 1,
  "pages": 1,
  "per_page": 1,
  "total": 1,
  "users": [
    {
      "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: A <what> name is 1 to 64 letters, digits or underscores
- 400: Invalid username: 2 to 32 lowercase letters, digits or underscores, starting with a letter
- 400: Username '<value>' is reserved
- 401: Authentication required
- 404: User '<family>' not found
