# GET /mail/log

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

UrbeStack release 0.2.35 API operation in the mail group.

Read recent or newly appended mail log lines

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

The response contains a log object. When after is omitted, the operation reads from the end of the mail log. The lines parameter defaults to 100 and accepts whole numbers from 0 to 1000. Use match to find text such as an email address, queue ID, or word within the last 4 MB of the log. The filter accepts up to 200 characters without control characters.

The response includes a byte offset you can pass as after to follow the log. If the log has restarted since that offset, the response reports the reset and returns unfiltered lines. Invalid values for lines, match, or after return 400.

## As a command

- [urbestack-mail-log](https://urbestack.com/docs/commands/urbestack-mail-log.md): Reads the latest lines from the end of the mail log.

## Parameters

- `lines` (query, integer, 1 to 1000)
- `match` (query, string, up to 200 characters)
- `after` (query, integer, 0 or more): Byte offset from an earlier response, given as a nonnegative whole number of up to 15 digits. The operation reads lines appended after that offset and applies match case-insensitively unless the log has restarted.

## 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/log?lines=1&match=text&after=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "log": {
    "exists": 1,
    "file": "urbestack-panel-20260909T101500Z.json.enc",
    "lines": [
      "text"
    ],
    "match": "text",
    "matched": 1,
    "offset": 1,
    "reset": 1,
    "size": 1,
    "truncated": 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: The filter is up to 200 printable characters
- 400: after must be a place in the log, a whole number
- 401: Authentication required
