Get User Monthly Stats
User
Get User Monthly Stats
/user//monthly
GET
Get User Monthly Stats
This endpoint requires authentication. Include your Bearer token in the Authorization header.
Description
/user//monthly Description:The
/user/{userId}/monthly endpoint allows users to retrieve monthly statistics like count and RoyaltyShare related to a specific user identified by their unique userId.
By default, returns the last 12 months of data. Use optional query parameters to filter specific date ranges.
Method:GET
Path Parameter:
| Parameter | Type | Description |
|---|---|---|
| userId | string | The unique identifier of the user. |
| Parameter | Type | Required | Description |
|---|---|---|---|
| period | string | No | Period preset: all, last12months, ytd, or custom. If custom, requires startDate/endDate. |
| startDate | string | No | Start date for filtering (YYYY-MM-DD format). Overrides period parameter. |
| endDate | string | No | End date for filtering (YYYY-MM-DD format). Overrides period parameter. |
- Custom dates (startDate/endDate) override period parameter
- Period presets are used if no custom dates provided
- Defaults to last 12 months if neither provided
/user/{id}/monthly- Returns last 12 months (default)/user/{id}/monthly?period=all- Returns all historical data/user/{id}/monthly?period=ytd- Returns year-to-date data/user/{id}/monthly?period=last12months- Same as default/user/{id}/monthly?startDate=2024-01-01&endDate=2024-12-31- Custom range (ignores period)/user/{id}/monthly?startDate=2024-06-01- From June 2024 to today
See Sample Response Below
Code Examples
Authorizations
JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"
Path Parameters
User ID
Query Parameters
Period preset for filtering monthly data
Available options:
all, last12months, ytd, custom Example:
"ytd"
Start date for filtering monthly data (YYYY-MM-DD format)
Example:
"2024-01-01"
End date for filtering monthly data (YYYY-MM-DD format)
Example:
"2024-12-31"