# analytics.of_messages: Direct messages chart and the best-selling message of one account, checked now on the account.

`GET /v2/accounts/{accountId}/analytics/direct-messages` · MCP tool `analytics_of_messages` · [Analytics and earnings](/v2/reference/analytics/)

## What it does

Direct messages chart and the best-selling message of one account, checked now on the account.

## When to use it

Returns the direct-messages statistics OnlyFans shows for one account over a period of UTC days: messages sent and paid messages bought, each with its total, its change and its chart, plus the mass message that sold the most. It is a live check on the account, three calls per request (when the account started, then the chart and the top message); ask for one account at a time and do not poll it. A period never starts before the account started on OnlyFans, as on the OnlyFans website: a period that would start earlier starts there, and date_from says so; a period that ended before the account started covers from that start until today instead, unless that would pass the limit of days of this read, in which case it keeps the days asked. It never changes anything.

## Permission and cost

| | |
| --- | --- |
| Permission | `analytics:read` |
| Effect | Read only: it never changes anything. |
| Cost class | `realtime` — costs 2 units (realtime call to the account on OnlyFans; also shows the account queue) |
| Scope | One account the key can use. |
| Period | No cap on days (`x-venuz-window-unbounded`): OnlyFans is read from the account start; date_to at most tomorrow. |

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `accountId` | path | string (uuid) | yes | Id of the account, from `accounts.list` or `api.whoami`. |
| `date_from` | query | string | yes | First UTC day of the period, YYYY-MM-DD. |
| `date_to` | query | string | yes | Last UTC day of the period, YYYY-MM-DD, at most tomorrow (UTC), which is served as today. |

## Example request (test mode)

With a test key in `VENUZ_API_KEY` (`export VENUZ_API_KEY=vzk_test_…`), this request changes nothing: test keys answer from a sample dataset.

```bash
curl -X GET "https://open.venuz.ai/v2/accounts/3a9e1c7b-2d4f-4b8a-9c6e-1f0d2b3a4c5e/analytics/direct-messages?date_from=date%20from&date_to=date%20to" \
  -H "Authorization: Bearer $VENUZ_API_KEY"
```

## Example response (200)

```json
{
  "account": {
    "id": "3a9e1c7b-2d4f-4b8a-9c6e-1f0d2b3a4c5e",
    "name": "Sample Creator",
    "connection": {
      "state": "connected",
      "last_connected_at": "2026-09-29T12:00:00.000Z"
    }
  },
  "data": {
    "date_from": "2026-08-30",
    "date_to": "2026-09-29",
    "direct_messages": {
      "total": 412,
      "delta": 12.5,
      "chart": [
        {
          "bucket_start": "2026-09-28",
          "count": 15
        },
        {
          "bucket_start": "2026-09-29",
          "count": 11
        }
      ]
    },
    "direct_message_purchases": {
      "total": 23,
      "delta": -4,
      "chart": [
        {
          "bucket_start": "2026-09-28",
          "count": 1
        },
        {
          "bucket_start": "2026-09-29",
          "count": 2
        }
      ]
    },
    "top_message": {
      "of_message_id": "2100000001",
      "sent_at": "2026-09-20T18:00:00.000Z",
      "text": {
        "untrusted_text": "Weekend special for my favorite fans"
      },
      "price_usd": 15,
      "is_free": false,
      "purchased_count": 40,
      "viewed_count": 310,
      "media_count": 3
    }
  },
  "source": "onlyfans",
  "synced_at": "2026-09-29T12:00:00.000Z"
}
```

## Response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `account` | object | yes | The OnlyFans account this data belongs to, with its connection state. |
| `account.id` | string (uuid) | yes |  |
| `account.name` | string | yes | Display name of the account in VENUZ, set by the agency. |
| `account.connection` | object | yes |  |
| `account.connection.state` | one of "connected", "connecting", "disconnected" | yes | Connection state of the OnlyFans account in VENUZ, from our stored record. Some accounts not yet moved to the new connection may read disconnected here; checks on the account are not available for them yet. |
| `account.connection.last_connected_at` | string (date-time), or null | yes | When VENUZ last saw the account connected. Null if never. |
| `data` | object | yes |  |
| `data.date_from` | string | yes |  |
| `data.date_to` | string | yes |  |
| `data.direct_messages` | object | yes | Direct messages sent over the period. |
| `data.direct_messages.total` | number | yes | Total over the period. |
| `data.direct_messages.delta` | number, or null | yes | The change OnlyFans reports against the previous period of the same length, as it gives it. Null when it gives none. |
| `data.direct_messages.chart` | array of object | yes | One point per day or bucket, as OnlyFans draws the chart. |
| `data.direct_messages.chart[].bucket_start` | string | yes | Start of the day or bucket, as OnlyFans gives it. |
| `data.direct_messages.chart[].count` | number | yes |  |
| `data.direct_message_purchases` | object | yes | Paid direct messages bought over the period. |
| `data.direct_message_purchases.total` | number | yes | Total over the period. |
| `data.direct_message_purchases.delta` | number, or null | yes | The change OnlyFans reports against the previous period of the same length, as it gives it. Null when it gives none. |
| `data.direct_message_purchases.chart` | array of object | yes | One point per day or bucket, as OnlyFans draws the chart. |
| `data.direct_message_purchases.chart[].bucket_start` | string | yes | Start of the day or bucket, as OnlyFans gives it. |
| `data.direct_message_purchases.chart[].count` | number | yes |  |
| `data.top_message` | object, or null | yes | The mass message that sold the most over the period, as OnlyFans picks it. Null when none sold. |
| `data.top_message.of_message_id` | string | yes | OnlyFans identifier, digits only, at most 9007199254740991. |
| `data.top_message.sent_at` | string (date-time) | yes | When it was sent, as OnlyFans gives it. ISO 8601 in UTC, as OnlyFans dates it; a value OnlyFans sends that is not a real instant is passed on as received. |
| `data.top_message.text` | untrusted_text | yes | The message text as sent (HTML as OnlyFans stores it). |
| `data.top_message.price_usd` | number, or null | yes | Price of the message; null when it was free. |
| `data.top_message.is_free` | boolean | yes |  |
| `data.top_message.purchased_count` | integer, or null | yes |  |
| `data.top_message.viewed_count` | integer, or null | yes |  |
| `data.top_message.media_count` | integer, or null | yes |  |
| `source` | one of "store", "onlyfans" | yes | store: read from the copy VENUZ keeps (fast, no load on the OnlyFans account). onlyfans: a live check on the account during this call. |
| `synced_at` | string (date-time) | yes | When this data was true. For source=store it is when VENUZ last updated its copy (or read it, if the record carries no update time); for source=onlyfans it is the moment OnlyFans answered. |

## Errors and what to do

Every error is `{ "error", "message", "fix", "docs_url", "request_id" }`. Branch on `error`; do what `fix` says.

| Error | HTTP | What to do |
| --- | --- | --- |
| [`invalid_request`](/errors/#invalid_request) | 400 | Send date_from and date_to as YYYY-MM-DD, from not after to, to at most tomorrow (UTC). |
| [`invalid_request`](/errors/#invalid_request) | 400 | Correct the request, then retry. When details.invalid_fields is present, each entry names a field and what it needs (its message); when details.reason is present, it says what is wrong. The parameters and body of every operation are in the specification. |
| [`invalid_api_key`](/errors/#invalid_api_key) | 401 | Send a valid key as "Authorization: Bearer vzk_live_..." (or vzk_test_...). If you lost the key, ask the agency to create a new one. |
| [`api_key_expired`](/errors/#api_key_expired) | 401 | Ask the agency to rotate the key or create a new one. Keys last at most 366 days. |
| [`api_key_revoked`](/errors/#api_key_revoked) | 401 | Stop using this key. Ask the agency for a new one if you still need access. |
| [`api_key_suspended`](/errors/#api_key_suspended) | 403 | If details.reason is creator_withdrawn, ask the agency owner to create a new key from an active member of the team. If it is suspended_by_venuz, contact VENUZ support: the same key works again as soon as the suspension is lifted, so do not delete it. |
| [`agency_inactive`](/errors/#agency_inactive) | 403 | The agency's VENUZ account is suspended or closed; access resumes when it is active again. Do not delete the key. |
| [`api_not_enabled`](/errors/#api_not_enabled) | 403 | Ask VENUZ support to enable API access for the agency. Keep the key: it works as soon as access is enabled. |
| [`ip_not_allowed`](/errors/#ip_not_allowed) | 403 | Send the request from one of the addresses allowed on the key, or ask the agency to update the allowed addresses. |
| [`insufficient_scope`](/errors/#insufficient_scope) | 403 | Call GET /v2/whoami to see what this key can do. Ask the agency to grant the missing permission (listed in details.missing_scopes) or to use a key that has it. If details.withheld_by_creator is true, the key has the permission but the person who created it cannot do this in VENUZ today: they need the role permissions in details.creator_missing_permissions (when details.creator_needs is any_of, any one of them is enough), or the agency must use a key created by someone who has them. |
| [`of_rejected`](/errors/#of_rejected) | 409 | Nothing was changed. Do not retry the same request: check that the item still exists on OnlyFans and that the account can see it on OnlyFans, then read again with a corrected request. |
| [`rate_limited`](/errors/#rate_limited) | 429 | Wait for the number of seconds in the Retry-After header, then retry. Spread requests out instead of retrying in a loop. Each request costs the units of its cost class (header X-Request-Cost: 1 for stored data, 2 for a realtime call to the OnlyFans account or a heavy query), and the RateLimit-* headers show how many units are left for this key and its agency in the current minute. |
| [`internal_error`](/errors/#internal_error) | 500 | Retry once after a few seconds; do not retry in a loop. If the request was a write, retry with the SAME Idempotency-Key, never a new one. If it keeps failing, contact VENUZ support and include the request_id. |
| [`api_halted`](/errors/#api_halted) | 503 | Wait for the number of seconds in the Retry-After header, then retry. Your key is still valid. |
| [`stored_data_unavailable`](/errors/#stored_data_unavailable) | 503 | Nothing was changed. Wait for the number of seconds in the Retry-After header, then retry once; do not retry in a loop. Narrowing the request (account_id or chat_id, a smaller limit) makes it lighter. If it keeps failing, contact VENUZ support with the request_id. |

VENUZ is independent software for agencies. It is not affiliated with, endorsed or sponsored by OnlyFans. OnlyFans is a trademark of its owner.
