> ## Documentation Index
> Fetch the complete documentation index at: https://www.dropfans.io/developers/llms.txt
> Use this file to discover all available pages before exploring further.

# GET /api/external/agency/stats — Revenue across your roster

> Revenue for the agency's own account plus every managed account it may see stats for (`canViewStats`), with a per-account breakdown — the same figures as the dashboard's "All creators" view.

- Source: https://www.dropfans.io/developers/reference/get-agency-stats
- Section: API reference
- OpenAPI: https://www.dropfans.io/developers/openapi.json

Revenue for the agency's own account plus every managed account it may see stats for (`canViewStats`), with a per-account breakdown — the same figures as the dashboard's "All creators" view.

Amounts are USD **dollars** (rounded to cents), excluding refunds and chargebacks: `gross` is buyer-paid minus VAT, `net` is the sellers' earnings after the platform fee. Days are UTC; the default range is the last 30 days. For one account's day-by-day chart and transactions, call [GET /api/external/earnings](https://www.dropfans.io/developers/reference/get-earnings.md) with `X-Dropfans-Account`.

## Authentication

`Authorization: Bearer dpfn_...` — an API key generated in the dashboard (Vault → API Connect). By default the key acts for the one account it belongs to. Missing or invalid keys return 401 `{"error":"Unauthorized","code":"unauthorized"}`.

Needs a verified agency's own key, sent without `X-Dropfans-Account` — these endpoints act as the agency itself.

## Query parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `startDate` | string |  | First UTC day (YYYY-MM-DD). Defaults to 29 days before today, so the default range is the last 30 days. |
| `endDate` | string |  | Last UTC day (YYYY-MM-DD), inclusive. Defaults to today. |

## Responses

### 200

Totals and per-account figures.

| Field | Type | Required | Description |
|---|---|---|---|
| `startDate` | string | yes | First UTC day included. |
| `endDate` | string | yes | Last UTC day included. |
| `currency` | `USD` | yes | Always "USD". |
| `total` | RevenueTotals | yes | Sum over every account below. |
| `accounts` | object[] | yes | The agency’s own account first, then every ACCEPTED managed account it may see stats for (canViewStats). |

```json
{
  "startDate": "2026-10-01",
  "endDate": "2026-10-26",
  "currency": "USD",
  "total": {
    "gross": 1240.5,
    "net": 992.4,
    "sales": 31,
    "tips": 12,
    "subscriptionPayments": 9
  },
  "accounts": [
    {
      "id": "cmh1agc0q0001ab7k2p9q4r8s",
      "username": "starlight_agency",
      "name": "Starlight Agency",
      "kind": "agency",
      "gross": 0,
      "net": 0,
      "sales": 0,
      "tips": 0,
      "subscriptionPayments": 0
    },
    {
      "id": "cmh4v2q8k0003xy9z7w6v5u4t",
      "username": "luna_ai",
      "name": "Luna",
      "kind": "creator",
      "gross": 820,
      "net": 656,
      "sales": 22,
      "tips": 8,
      "subscriptionPayments": 6
    },
    {
      "id": "cmh3k9p2a0002cd5e6f7g8h9j",
      "username": "valeria",
      "name": "Valeria",
      "kind": "creator",
      "gross": 420.5,
      "net": 336.4,
      "sales": 9,
      "tips": 4,
      "subscriptionPayments": 3
    }
  ]
}
```

## Errors

| Status | Body | When |
|---|---|---|
| 400 | `{"error":"Agency endpoints act as the agency itself — send them without X-Dropfans-Account.","code":"account_header_not_allowed"}` | The request carried `X-Dropfans-Account`. Agency endpoints always act as the agency. |
| 401 | `{"error":"Unauthorized","code":"unauthorized"}` | Missing or invalid API key. |
| 403 | `{"error":"This endpoint needs a verified agency's own API key.","code":"agency_key_required"}` | The key is not a verified agency’s own key — a creator’s key, or a key an agency minted for one of its creators. |
| 400 | `{"error":"startDate/endDate must be YYYY-MM-DD with start ≤ end"}` | Malformed dates, or start after end. |

## Rate limiting

Per-key fixed windows by tier (Personal 60/min · 5,000/day; approved apps 300/min · 50,000/day; Dropfans-operated integrations exempt). Read the live values from X-RateLimit-Tier, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and their -Day variants; a 429 carries Retry-After and `{"error":"Rate limit exceeded","code":"rate_limited"}`. See [Rate limits](https://www.dropfans.io/developers/concepts/rate-limits.md).

## Code samples

### curl

```bash
curl "https://www.dropfans.io/api/external/agency/stats?startDate=2026-10-01&endDate=2026-10-26" \
  -H "Authorization: Bearer $DROPFANS_API_KEY"
```

### Node

```javascript
const res = await fetch(`https://www.dropfans.io/api/external/agency/stats?startDate=2026-10-01&endDate=2026-10-26`, {
  headers: {
    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,
  },
});
console.log(await res.json());
```

### Python

```python
import os
import requests

res = requests.get(
    "https://www.dropfans.io/api/external/agency/stats",
    headers={"Authorization": f"Bearer {os.environ['DROPFANS_API_KEY']}"},
    params={"startDate": "2026-10-01", "endDate": "2026-10-26"},
)
print(res.json())
```

## OpenAPI

```json
{
  "method": "GET",
  "path": "/api/external/agency/stats",
  "operationId": "getAgencyStats",
  "tags": [
    "agency"
  ],
  "summary": "Revenue across your roster",
  "description": "Revenue for the agency's own account plus every managed account it may see stats for (`canViewStats`), with a per-account breakdown — the same figures as the dashboard's \"All creators\" view.\n\nAmounts are USD **dollars** (rounded to cents), excluding refunds and chargebacks: `gross` is buyer-paid minus VAT, `net` is the sellers' earnings after the platform fee. Days are UTC; the default range is the last 30 days. For one account's day-by-day chart and transactions, call [GET /api/external/earnings](https://www.dropfans.io/developers/reference/get-earnings.md) with `X-Dropfans-Account`.",
  "parameters": [
    {
      "name": "startDate",
      "in": "query",
      "required": false,
      "description": "First UTC day (YYYY-MM-DD). Defaults to 29 days before today, so the default range is the last 30 days.",
      "schema": {
        "type": "string",
        "format": "date"
      },
      "example": "2026-10-01"
    },
    {
      "name": "endDate",
      "in": "query",
      "required": false,
      "description": "Last UTC day (YYYY-MM-DD), inclusive. Defaults to today.",
      "schema": {
        "type": "string",
        "format": "date"
      },
      "example": "2026-10-26"
    }
  ],
  "responses": {
    "200": {
      "description": "Totals and per-account figures.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-Dropfans-Account": {
          "description": "The id of the account this request acted on — the key’s own account, or the managed account named in the X-Dropfans-Account request header. Assert it when acting for several accounts.",
          "schema": {
            "type": "string"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "startDate": {
                "type": "string",
                "description": "First UTC day included.",
                "format": "date",
                "example": "2026-09-27"
              },
              "endDate": {
                "type": "string",
                "description": "Last UTC day included.",
                "format": "date",
                "example": "2026-10-26"
              },
              "currency": {
                "type": "string",
                "description": "Always \"USD\".",
                "enum": [
                  "USD"
                ]
              },
              "total": {
                "type": "object",
                "properties": {
                  "gross": {
                    "type": "number",
                    "description": "USD **dollars**, buyer-paid minus VAT, excluding refunds and chargebacks.",
                    "example": 1240.5
                  },
                  "net": {
                    "type": "number",
                    "description": "USD dollars, the seller’s earnings after the platform fee.",
                    "example": 992.4
                  },
                  "sales": {
                    "type": "integer",
                    "description": "Paid drop orders.",
                    "example": 31
                  },
                  "tips": {
                    "type": "integer",
                    "description": "Paid tips.",
                    "example": 12
                  },
                  "subscriptionPayments": {
                    "type": "integer",
                    "description": "Subscription charges and renewals.",
                    "example": 9
                  }
                },
                "required": [
                  "gross",
                  "net",
                  "sales",
                  "tips",
                  "subscriptionPayments"
                ]
              },
              "accounts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "The account’s user id."
                    },
                    "username": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Public @handle."
                    },
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Display name."
                    },
                    "kind": {
                      "type": "string",
                      "description": "`agency` = the agency’s own account; `creator` = a managed creator or AI persona.",
                      "enum": [
                        "agency",
                        "creator"
                      ]
                    },
                    "gross": {
                      "type": "number",
                      "description": "USD dollars, as in RevenueTotals."
                    },
                    "net": {
                      "type": "number",
                      "description": "USD dollars, as in RevenueTotals."
                    },
                    "sales": {
                      "type": "integer",
                      "description": "Paid drop orders."
                    },
                    "tips": {
                      "type": "integer",
                      "description": "Paid tips."
                    },
                    "subscriptionPayments": {
                      "type": "integer",
                      "description": "Subscription charges and renewals."
                    }
                  },
                  "required": [
                    "id",
                    "kind",
                    "gross",
                    "net",
                    "sales",
                    "tips",
                    "subscriptionPayments"
                  ],
                  "description": "One account’s figures: id, username, name, kind plus the RevenueTotals fields."
                },
                "description": "The agency’s own account first, then every ACCEPTED managed account it may see stats for (canViewStats)."
              }
            },
            "required": [
              "startDate",
              "endDate",
              "currency",
              "total",
              "accounts"
            ]
          },
          "example": {
            "startDate": "2026-10-01",
            "endDate": "2026-10-26",
            "currency": "USD",
            "total": {
              "gross": 1240.5,
              "net": 992.4,
              "sales": 31,
              "tips": 12,
              "subscriptionPayments": 9
            },
            "accounts": [
              {
                "id": "cmh1agc0q0001ab7k2p9q4r8s",
                "username": "starlight_agency",
                "name": "Starlight Agency",
                "kind": "agency",
                "gross": 0,
                "net": 0,
                "sales": 0,
                "tips": 0,
                "subscriptionPayments": 0
              },
              {
                "id": "cmh4v2q8k0003xy9z7w6v5u4t",
                "username": "luna_ai",
                "name": "Luna",
                "kind": "creator",
                "gross": 820,
                "net": 656,
                "sales": 22,
                "tips": 8,
                "subscriptionPayments": 6
              },
              {
                "id": "cmh3k9p2a0002cd5e6f7g8h9j",
                "username": "valeria",
                "name": "Valeria",
                "kind": "creator",
                "gross": 420.5,
                "net": 336.4,
                "sales": 9,
                "tips": 4,
                "subscriptionPayments": 3
              }
            ]
          }
        }
      }
    },
    "400": {
      "description": "The request carried `X-Dropfans-Account`. Agency endpoints always act as the agency. Also: Malformed dates, or start after end.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Agency endpoints act as the agency itself — send them without X-Dropfans-Account.",
            "code": "account_header_not_allowed"
          }
        }
      }
    },
    "401": {
      "description": "Missing or invalid API key.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Unauthorized",
            "code": "unauthorized"
          }
        }
      }
    },
    "403": {
      "description": "The key is not a verified agency’s own key — a creator’s key, or a key an agency minted for one of its creators.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "This endpoint needs a verified agency's own API key.",
            "code": "agency_key_required"
          }
        }
      }
    },
    "429": {
      "description": "Rate limit exceeded for the current minute or day window. Wait Retry-After seconds and retry.",
      "headers": {
        "X-RateLimit-Tier": {
          "description": "Rate-limit tier of the key: personal, app or first_party (first_party is unlimited).",
          "schema": {
            "type": "string",
            "enum": [
              "personal",
              "app",
              "first_party"
            ]
          }
        },
        "X-RateLimit-Limit": {
          "description": "Requests allowed per minute for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining": {
          "description": "Requests left in the current minute window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset": {
          "description": "Epoch seconds when the minute window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Limit-Day": {
          "description": "Requests allowed per UTC day for this key (absent on first_party).",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Remaining-Day": {
          "description": "Requests left in the current UTC day window.",
          "schema": {
            "type": "integer"
          }
        },
        "X-RateLimit-Reset-Day": {
          "description": "Epoch seconds when the day window resets.",
          "schema": {
            "type": "integer"
          }
        },
        "Retry-After": {
          "description": "Seconds to wait before retrying (sent with 429s).",
          "schema": {
            "type": "integer"
          }
        }
      },
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "error": {
                "type": "string",
                "description": "Human-readable message.",
                "example": "Rate limit exceeded"
              },
              "code": {
                "type": "string",
                "description": "Machine-readable code: unauthorized, app_suspended, first_party_only, rate_limited, username_required, invalid_account_header, account_not_managed, permission_denied, account_header_not_allowed, agency_key_required — plus endpoint-specific codes listed on each reference page.",
                "example": "rate_limited"
              }
            },
            "required": [
              "error",
              "code"
            ]
          },
          "example": {
            "error": "Rate limit exceeded",
            "code": "rate_limited"
          }
        }
      }
    }
  },
  "x-codeSamples": [
    {
      "lang": "cURL",
      "label": "curl",
      "source": "curl \"https://www.dropfans.io/api/external/agency/stats?startDate=2026-10-01&endDate=2026-10-26\" \\\n  -H \"Authorization: Bearer $DROPFANS_API_KEY\""
    },
    {
      "lang": "JavaScript",
      "label": "Node",
      "source": "const res = await fetch(`https://www.dropfans.io/api/external/agency/stats?startDate=2026-10-01&endDate=2026-10-26`, {\n  headers: {\n    Authorization: `Bearer ${process.env.DROPFANS_API_KEY}`,\n  },\n});\nconsole.log(await res.json());"
    },
    {
      "lang": "Python",
      "source": "import os\nimport requests\n\nres = requests.get(\n    \"https://www.dropfans.io/api/external/agency/stats\",\n    headers={\"Authorization\": f\"Bearer {os.environ['DROPFANS_API_KEY']}\"},\n    params={\"startDate\": \"2026-10-01\", \"endDate\": \"2026-10-26\"},\n)\nprint(res.json())"
    }
  ],
  "x-dropfans-docs": "https://www.dropfans.io/developers/reference/get-agency-stats"
}
```

---

Previous: [Stop managing a creator](https://www.dropfans.io/developers/reference/end-management.md) · Next: [List your vault items — the source of media for posts](https://www.dropfans.io/developers/reference/list-vault.md) · All pages: [llms.txt](https://www.dropfans.io/developers/llms.txt)
