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
Authentication
This endpoint requires authentication. Include your bearer token in the Authorization header.Path Parameters
Parameter | Type | In | Required | Description |
---|---|---|---|---|
id | string | path | ✅ | User ID |
Query Parameters
Parameter | Type | In | Required | Description |
---|---|---|---|---|
period | string | query | ❌ | Period preset for filtering monthly data |
startDate | string | query | ❌ | Start date for filtering monthly data (YYYY-MM-DD format) |
endDate | string | query | ❌ | End date for filtering monthly data (YYYY-MM-DD format) |
Responses
✅ 200 - success
yearToDate
allTimeData
⚠️ 400 - Bad Request - Invalid date format or date range
invalidFormat
invalidRange
invalidPeriod
customWithoutDates
⚠️ 401 - Unauthorized
⚠️ 404 - Not Found
❌ 500 - Internal Server Error
Tags
User
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"