# GET /mail/accounts/{address}/activity

First published 14 Oct 2026 (release 0.2.0) · Unchanged since publication

UrbeStack release 0.2.35 API operation in the mail group.

Get a mailbox's activity report

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

The report uses the mail logs to compare hourly send counts with the mailbox's usual daily volume. It lists sending IP addresses, when each was first and last seen, and whether it is new. It counts failed sign-ins by hour, separating SMTP from IMAP and POP3, and groups successful mailbox sign-ins by IP address and device. It also shows recipient domains, message subjects, receiving servers' responses, and traffic in bytes per device since the start of the month and across the weeks covered by the retained logs.

The report flags possible compromise if the mailbox reaches its hourly sending limit or the spam filter rejects an outgoing message. It also flags a day when the mailbox sends at least 100 messages and at least 10 times its usual daily volume, if the first message that day comes from an IP address with no prior sign-in for the mailbox.

Resellers can view activity only for mailboxes on their own domains and those of their customers. The API returns 400 if hours exceeds 168 or fails validation as a nonnegative whole number.

## As a command

- [urbestack-mail-activity](https://urbestack.com/docs/commands/urbestack-mail-activity.md): Reports activity for one mailbox using the mail logs.

## Parameters

- `address` (path, MailAddress, required)
- `hours` (query, integer, 1 to 168): Lookback period in hours, from 1 to 168. The default is 48 hours if omitted or set to 0.

## 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/accounts/info@example.com/activity?hours=1" \
  -H "Authorization: Bearer $TOKEN"
```

Response, 200 OK:

```
{
  "activity": {
    "account": {},
    "address": "info@example.com",
    "compromised": true,
    "devices": [
      {}
    ],
    "failed": {},
    "hours": 1,
    "ip_count": 1,
    "ips": [
      {}
    ],
    "logs": {},
    "logs_reach_month_start": true,
    "mailbox_logins": [
      {}
    ],
    "month_start": "text",
    "per_hour": [
      {}
    ],
    "queued": {},
    "read_at": "text",
    "rejected": [
      {}
    ],
    "responses": {},
    "rules": [
      {}
    ],
    "scan": {},
    "sent": {},
    "server_time": "text",
    "since": "text",
    "spam_checks": {},
    "statuses": {},
    "timezone": "text",
    "top": {}
  }
}
```

## Errors

- 400: --address is required
- 400: <what> must be a whole number from 0 to <max>
- 400: <what> must be text without control characters, 1 to <max> characters
- 400: Domain name required
- 400: Domain name too long
- 400: Invalid IPv4 address
- 400: Invalid IPv6 address
- 400: Invalid domain name
- 400: Invalid mail address
- 400: Invalid mail address: local part over 64 characters
- 400: Invalid mail address: no local part
- 400: Invalid mail address: the local part may hold letters, digits, dots, _ + and -
- 400: Invalid port
- 400: Invalid setting key
- 401: Authentication required
- 404: No mailbox <address> here
- 404: No such user: <owner>
- 404: Setting '<key>' not found
