# GET /mail/lists

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

UrbeStack release 0.2.35 API operation in the mail group.

List entries in the server-wide mail sender lists

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

Returns entries and total for the server-wide allow, block and nogreylist lists, sorted by kind and then by entry. The kind and match filters apply to both entries and total.

With neither limit nor offset, the response includes all matching entries. Supply either parameter to get one page and receive limit, offset, kinds and max. Invalid filter or pagination values return 400. Requires an administrator token with the mail scope.

## Parameters

- `kind` (query, string, one of allow, block, nogreylist): List to include, one of allow, block or nogreylist. Omit kind to include all three lists.
- `match` (query, string, up to 200 characters): Substring to match in list entries, up to 200 characters with no control characters. An empty string leaves the results unfiltered by text.
- `limit` (query, integer, 1 to 1000): Maximum number of entries to return per page, from 1 to 1000. Defaults to 200 when offset is supplied and limit is omitted.
- `offset` (query, integer, 0 to 1000000): Number of matching entries to skip, from 0 to 1,000,000. Defaults to 0 when limit is supplied and offset is omitted.

## 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/mail/lists?kind=allow&match=text&limit=1&offset=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "entries": [
    {
      "created_at": "2026-09-09T10:15:00Z",
      "domain": "example.com",
      "entry": "text",
      "id": 1,
      "kind": "profile"
    }
  ],
  "kinds": {
    "allow": 1,
    "block": 1,
    "nogreylist": 1
  },
  "limit": 1,
  "max": 1,
  "offset": 1,
  "total": 1
}
```

## Errors

- 400: <what> must be a whole number from 0 to <max>
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: List type must be allow, block, or nogreylist.
- 400: limit is a number from 1 to 1000
- 400: offset must be a non-negative integer.
- 401: Authentication required
