Sofa
Dashboard

Get watch history

Fetch the user's watch counts grouped by time period. Useful for rendering activity charts.

GET
/dashboard/watch-history
better-auth.session_token<token>

Better Auth session cookie

In: cookie

Query Parameters

type*string

What to count: movie watches or episode watches

Value in"movie" | "episode"
period*string

Time range for the histogram

Value in"today" | "this_week" | "this_month" | "this_year"

Response Body

application/json

curl -X GET "http://localhost:3000/api/v1/dashboard/watch-history?type=movie&period=today"
{
  "count": 0,
  "history": [
    {
      "bucket": "string",
      "count": 0
    }
  ]
}