openapi: 3.1.0 info: title: activitypub-mcp API version: 1.1.0 description: | HTTP API for **activitypub-mcp** — a personal ActivityPub bot that follows and archives public posts, and exposes the archived data over a read-only REST API (and an equivalent MCP server). This document covers three surfaces: - **REST API** (`/api/v1`) — a read-only JSON API over the archived data, gated by an API key. Every endpoint mirrors an MCP tool and returns byte-identical data. - **ActivityPub federation** — the actor document, inbox, outbox and collections used by other fediverse servers. - **Discovery & health** — WebFinger, NodeInfo and a health probe. The HTML admin UI (`/admin/*`) and the MCP protocol endpoint (`/mcp`) are intentionally not modelled here: the former serves HTML forms, the latter speaks the MCP StreamableHTTP protocol rather than a REST contract. ## REST request methods Each `/api/v1` data endpoint accepts the same input three ways: - **GET** — parameters as a query string (`?actor_handle=@a@b&limit=5`); arrays are repeated or comma-separated. String values are coerced to the declared types. - **POST** — a JSON body identical to the MCP tool input. - **QUERY** (RFC 9110-style) — a JSON body identical to POST. OpenAPI cannot express the custom `QUERY` method, so only GET and POST are listed per endpoint; `QUERY` behaves exactly like POST. ## Errors REST endpoints return JSON `{ "error": string }` bodies with these statuses: - `400` — request failed schema validation (includes an `issues` array). - `401` — missing or invalid API key. - `404` — a referenced actor handle could not be resolved. - `500` — unexpected internal error. - `503` — the REST API is disabled (`REST_API_KEY` is not configured). license: name: ISC servers: - url: https://{domain} description: Deployed instance variables: domain: default: bot.skvip.lol description: The instance domain (APP_DOMAIN). tags: - name: REST API description: Read-only JSON API over archived ActivityPub/BookWyrm/Last.fm data. - name: ActivityPub description: Federation endpoints consumed by other fediverse servers. - name: Discovery description: WebFinger and NodeInfo discovery documents. - name: Health description: Liveness probe. security: - BearerAuth: [] - ApiKeyAuth: [] paths: # ----------------------------------------------------------------- REST API /api/v1: get: tags: [REST API] summary: Discovery document description: | Machine-readable description of the REST API: every endpoint, the MCP tool it wraps, and its parameter names. Generated from the same table that defines the routes, so it never drifts. operationId: getDiscovery responses: "200": description: API description. content: application/json: schema: type: object properties: service: type: string example: activitypub-mcp REST API version: type: string example: v1 methods: type: object additionalProperties: type: string auth: type: string endpoints: type: array items: type: object properties: path: type: string example: /api/v1/actor-posts mcp_tool: type: string example: get_actor_posts description: type: string params: type: array items: type: string "401": $ref: "#/components/responses/Unauthorized" "503": $ref: "#/components/responses/Disabled" /api/v1/actor-posts: get: tags: [REST API] summary: Get posts from an actor description: | Posts from a specific ActivityPub actor. Defaults to newest-first; set `sort_order=asc` with `limit=1` for the earliest post, and follow `next_cursor` for deep traversal. **Public posts only.** This endpoint serves posts the origin server marked public; followers-only, unlisted and unaddressed posts are withheld. The matching MCP tool returns the whole archive. See ADR 0026. operationId: getActorPostsGet parameters: - $ref: "#/components/parameters/ActorHandleRequired" - name: limit in: query schema: { type: integer, minimum: 1, maximum: 100, default: 20 } - name: since in: query description: ISO 8601 datetime — only posts after this time. schema: { type: string, format: date-time } - name: until in: query description: ISO 8601 datetime — only posts before this time. schema: { type: string, format: date-time } - name: object_types in: query description: Filter by object type, e.g. `Note,Article`. schema: { type: array, items: { type: string } } - name: tag in: query description: | Only posts carrying this hashtag (case-insensitive, leading `#` optional), e.g. `togselfie`. Filtered in SQL so `limit` counts matching posts and pagination stays correct. schema: { type: string } - $ref: "#/components/parameters/SortOrder" - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of posts. content: application/json: schema: { $ref: "#/components/schemas/ActorPostsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get posts from an actor (JSON body) operationId: getActorPostsPost requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/ActorPostsRequest" } responses: "200": description: Page of posts. content: application/json: schema: { $ref: "#/components/schemas/ActorPostsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/actor-reading-status: get: tags: [REST API] summary: Get BookWyrm reading status for an actor description: | Reading status for an actor by querying the live shelf (`use_live=true`, default) or the local DB. BookWyrm shelf collections are bare Edition objects, so BOTH modes derive `started_date`/`finished_date`/`rating` from the actor's stored public statuses (day granularity; a "read" comment or a review marks the finish) — live mode merges those onto the authoritative shelf rows by Edition URL (title fallback) and adds `shelved_date` when the shelf carries it. Cover, pages and language are backfilled from the cached book metadata for enriched books (the live shelf remains ground truth for cover art). Returns one entry per book (title, authors, cover, shelf, dates, rating, bookwyrm_book_url, pages, language, shelved_date). operationId: getActorReadingStatusGet parameters: - $ref: "#/components/parameters/ActorHandleRequired" - name: status in: query schema: { type: string, enum: [reading, read, to-read, stopped-reading] } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 50, default: 10 } - name: use_live in: query description: Fetch the live shelf from the BookWyrm instance (ground truth) instead of local data. schema: { type: boolean, default: true } - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } responses: "200": description: Reading status entries. content: application/json: schema: type: array items: { $ref: "#/components/schemas/ReadingStatus" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get BookWyrm reading status (JSON body) operationId: getActorReadingStatusPost requestBody: required: true content: application/json: schema: type: object required: [actor_handle] properties: include_hidden: { type: boolean, default: false } actor_handle: { type: string } status: { type: string, enum: [reading, read, to-read, stopped-reading], } limit: { type: integer, minimum: 1, maximum: 50, default: 10 } use_live: { type: boolean, default: true } responses: "200": description: Reading status entries. content: application/json: schema: type: array items: { $ref: "#/components/schemas/ReadingStatus" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/actor-media: get: tags: [REST API] summary: Get posts with image/video attachments description: | **Public posts only.** This endpoint serves posts the origin server marked public; followers-only, unlisted and unaddressed posts are withheld. The matching MCP tool returns the whole archive. See ADR 0026. operationId: getActorMediaGet parameters: - $ref: "#/components/parameters/ActorHandleRequired" - name: media_type in: query schema: { type: string, enum: [image, video, any], default: any } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 100, default: 20 } - name: since in: query description: ISO 8601 datetime. schema: { type: string, format: date-time } responses: "200": description: Posts with media attachments. content: application/json: schema: { $ref: "#/components/schemas/ActorMediaResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get posts with image/video attachments (JSON body) description: | **Public posts only.** This endpoint serves posts the origin server marked public; followers-only, unlisted and unaddressed posts are withheld. The matching MCP tool returns the whole archive. See ADR 0026. operationId: getActorMediaPost requestBody: required: true content: application/json: schema: type: object required: [actor_handle] properties: actor_handle: { type: string } media_type: { type: string, enum: [image, video, any], default: any } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } since: { type: string, format: date-time } responses: "200": description: Posts with media attachments. content: application/json: schema: { $ref: "#/components/schemas/ActorMediaResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/search-actor-content: get: tags: [REST API] summary: Full-text search across stored posts description: | Case-insensitive substring search over post content and summary, for one actor or all followed actors. **Public posts only.** This endpoint serves posts the origin server marked public; followers-only, unlisted and unaddressed posts are withheld. The matching MCP tool returns the whole archive. See ADR 0026. operationId: searchActorContentGet parameters: - name: query in: query required: true description: Search terms. schema: { type: string, minLength: 1 } - name: actor_handle in: query description: Scope to a specific actor; omit to search all followed actors. schema: { type: string } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 50, default: 20 } - name: object_types in: query schema: { type: array, items: { type: string } } responses: "200": description: Search results. content: application/json: schema: { $ref: "#/components/schemas/SearchResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Full-text search across stored posts (JSON body) operationId: searchActorContentPost requestBody: required: true content: application/json: schema: type: object required: [query] properties: query: { type: string, minLength: 1 } actor_handle: { type: string } limit: { type: integer, minimum: 1, maximum: 50, default: 20 } object_types: { type: array, items: { type: string } } responses: "200": description: Search results. content: application/json: schema: { $ref: "#/components/schemas/SearchResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/follows: get: tags: [REST API] summary: List followed actors description: The actors this server is following, with follow status. operationId: getFollowsGet parameters: - name: status in: query schema: { type: string, enum: [pending, accepted, rejected, all], default: accepted, } responses: "200": description: Follow records. content: application/json: schema: type: array items: { $ref: "#/components/schemas/Follow" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: List followed actors (JSON body) operationId: getFollowsPost requestBody: required: false content: application/json: schema: type: object properties: status: { type: string, enum: [pending, accepted, rejected, all], default: accepted, } responses: "200": description: Follow records. content: application/json: schema: type: array items: { $ref: "#/components/schemas/Follow" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/activity-stats: get: tags: [REST API] summary: Aggregate statistics about stored posts operationId: getActivityStatsGet parameters: - name: actor_handle in: query description: Scope to an actor; omit for all. schema: { type: string } - name: since in: query description: ISO 8601 datetime. schema: { type: string, format: date-time } responses: "200": description: Aggregate statistics. content: application/json: schema: { $ref: "#/components/schemas/ActivityStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate statistics about stored posts (JSON body) operationId: getActivityStatsPost requestBody: required: false content: application/json: schema: type: object properties: actor_handle: { type: string } since: { type: string, format: date-time } responses: "200": description: Aggregate statistics. content: application/json: schema: { $ref: "#/components/schemas/ActivityStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/hashtag-stats: get: tags: [REST API] summary: Aggregate hashtag usage for an actor description: | Hashtag analytics over stored posts: totals, a posts-with-hashtags ratio, top hashtags with per-tag first/last used, and top co-occurring pairs. Scoped by default to the configured OWNER_ACTOR when actor_handle is omitted. operationId: getHashtagStatsGet parameters: - name: actor_handle in: query description: Scope to an actor; omit for the configured owner (or all posts). schema: { type: string } - name: tag in: query description: Restrict the snapshot to posts carrying this hashtag. schema: { type: string } - name: from in: query schema: { type: string, format: date-time } - name: to in: query schema: { type: string, format: date-time } - name: since in: query schema: { type: string, format: date-time } - name: limit in: query description: Top-N size for hashtags and co-occurring pairs. schema: { type: integer, minimum: 1, maximum: 200, default: 30 } responses: "200": description: Hashtag statistics. content: application/json: schema: { $ref: "#/components/schemas/HashtagStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate hashtag usage for an actor (JSON body) operationId: getHashtagStatsPost requestBody: required: false content: application/json: schema: type: object properties: actor_handle: { type: string } tag: { type: string } from: { type: string, format: date-time } to: { type: string, format: date-time } since: { type: string, format: date-time } limit: { type: integer, minimum: 1, maximum: 200, default: 30 } responses: "200": description: Hashtag statistics. content: application/json: schema: { $ref: "#/components/schemas/HashtagStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/hashtag-trends: get: tags: [REST API] summary: Hashtag usage over time description: | Time series of hashtag usage bucketed by week, month, or year. Without a tag, each point reports total uses and distinct hashtags; with a tag, the per-period count for that hashtag. Series runs oldest to newest. operationId: getHashtagTrendsGet parameters: - name: actor_handle in: query description: Scope to an actor; omit for the configured owner (or all posts). schema: { type: string } - name: tag in: query description: Chart a single hashtag's count per period. schema: { type: string } - name: group_by in: query schema: { type: string, enum: [week, month, year], default: month } - name: from in: query schema: { type: string, format: date-time } - name: to in: query schema: { type: string, format: date-time } - name: since in: query schema: { type: string, format: date-time } - name: limit in: query description: Maximum number of periods returned (newest kept). schema: { type: integer, minimum: 1, maximum: 500, default: 120 } responses: "200": description: Hashtag usage time series. content: application/json: schema: { $ref: "#/components/schemas/HashtagTrendsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Hashtag usage over time (JSON body) operationId: getHashtagTrendsPost requestBody: required: false content: application/json: schema: type: object properties: actor_handle: { type: string } tag: { type: string } group_by: { type: string, enum: [week, month, year], default: month } from: { type: string, format: date-time } to: { type: string, format: date-time } since: { type: string, format: date-time } limit: { type: integer, minimum: 1, maximum: 500, default: 120 } responses: "200": description: Hashtag usage time series. content: application/json: schema: { $ref: "#/components/schemas/HashtagTrendsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/engagement: get: tags: [REST API] summary: Live engagement counts for statuses description: | Current favourite/boost/reply counts for one or more public statuses, read live from each status's origin instance (Mastodon REST API first, ActivityPub collection totals as fallback). Accepts permalinks, AP object ids, or bare numeric ids resolved against OWNER_INSTANCE. NOTE: unless snapshot=false, every call — including GET — records a snapshot row per status; skip_unchanged=true suppresses writes identical to the latest snapshot. Failures are per-item, never the whole batch. operationId: getEngagementGet parameters: - name: statuses in: query required: true description: Status references; repeat the param or comma-separate. schema: { type: array, items: { type: string } } - name: snapshot in: query description: Record a snapshot row per successful read. schema: { type: boolean, default: true } - name: skip_unchanged in: query description: Skip the write when counts equal the latest snapshot. schema: { type: boolean, default: false } - name: prefer in: query description: Force a fetch path; `ap` swaps the fallback order. schema: { type: string, enum: [rest, ap], default: rest } responses: "200": description: Per-status engagement results, preserving input order. content: application/json: schema: { $ref: "#/components/schemas/EngagementResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Live engagement counts for statuses (JSON body) operationId: getEngagementPost requestBody: required: true content: application/json: schema: type: object required: [statuses] properties: statuses: { type: array, items: { type: string } } snapshot: { type: boolean, default: true } skip_unchanged: { type: boolean, default: false } prefer: { type: string, enum: [rest, ap], default: rest } responses: "200": description: Per-status engagement results, preserving input order. content: application/json: schema: { $ref: "#/components/schemas/EngagementResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/engagement-trends: get: tags: [REST API] summary: Engagement history for one status description: | A status's stored engagement snapshots as a time series (needs at least one prior /engagement sample). Buckets by hour, day, week, or month; each point carries the latest counts observed in the bucket plus the delta vs the previous bucket. Deltas can be negative — favourites and boosts can be undone. Series runs oldest to newest. operationId: getEngagementTrendsGet parameters: - name: status in: query required: true description: One status reference (permalink, AP id, or bare id). schema: { type: string } - name: group_by in: query schema: { type: string, enum: [hour, day, week, month], default: day } - name: metric in: query description: Narrow the series to one count as `{value, delta}` points. schema: { type: string, enum: [favourites, reblogs, replies, all], default: all, } - name: from in: query schema: { type: string, format: date-time } - name: to in: query schema: { type: string, format: date-time } - name: since in: query schema: { type: string, format: date-time } - name: limit in: query description: Maximum number of buckets returned (newest kept). schema: { type: integer, minimum: 1, maximum: 1000, default: 120 } responses: "200": description: Engagement time series. content: application/json: schema: { $ref: "#/components/schemas/EngagementTrendsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Engagement history for one status (JSON body) operationId: getEngagementTrendsPost requestBody: required: true content: application/json: schema: type: object required: [status] properties: status: { type: string } group_by: { type: string, enum: [hour, day, week, month], default: day } metric: { type: string, enum: [favourites, reblogs, replies, all], default: all, } from: { type: string, format: date-time } to: { type: string, format: date-time } since: { type: string, format: date-time } limit: { type: integer, minimum: 1, maximum: 1000, default: 120 } responses: "200": description: Engagement time series. content: application/json: schema: { $ref: "#/components/schemas/EngagementTrendsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/recent-activities: get: tags: [REST API] summary: Most recently received activities operationId: getRecentActivitiesGet parameters: - name: limit in: query schema: { type: integer, minimum: 1, maximum: 100, default: 50 } - name: types in: query description: Filter by activity type. schema: { type: array, items: { type: string } } - name: since in: query description: ISO 8601 datetime. schema: { type: string, format: date-time } responses: "200": description: Recent activities. content: application/json: schema: type: array items: { $ref: "#/components/schemas/RecentActivity" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Most recently received activities (JSON body) operationId: getRecentActivitiesPost requestBody: required: false content: application/json: schema: type: object properties: limit: { type: integer, minimum: 1, maximum: 100, default: 50 } types: { type: array, items: { type: string } } since: { type: string, format: date-time } responses: "200": description: Recent activities. content: application/json: schema: type: array items: { $ref: "#/components/schemas/RecentActivity" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/reading-events: get: tags: [REST API] summary: BookWyrm reading events description: | Reading events derived from the actor's stored note posts, with a normalized `event_type` (including `quotation`). Each event carries signal dates (`started_date`/`finished_date` when this event marks a start/finish), the book's derived overall window (`book_started_date`/`book_finished_date`), inline `rating`, `review_title`, `quote` and `progress`/`progress_mode` when present. Defaults to newest-first; follow `next_cursor` for deep traversal. operationId: getReadingEventsGet parameters: - $ref: "#/components/parameters/ActorHandleRequired" - name: event_type in: query schema: { $ref: "#/components/schemas/EventType" } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 100, default: 20 } - name: since in: query description: ISO 8601 datetime — only events after this time. schema: { type: string, format: date-time } - $ref: "#/components/parameters/SortOrder" - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of reading events. content: application/json: schema: { $ref: "#/components/schemas/ReadingEventsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: BookWyrm reading events (JSON body) operationId: getReadingEventsPost requestBody: required: true content: application/json: schema: type: object required: [actor_handle] properties: actor_handle: { type: string } event_type: { $ref: "#/components/schemas/EventType" } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } since: { type: string, format: date-time } sort_order: { type: string, enum: [asc, desc], default: desc } cursor: { type: string } responses: "200": description: Page of reading events. content: application/json: schema: { $ref: "#/components/schemas/ReadingEventsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/scrobbles: get: tags: [REST API] summary: Query Last.fm scrobble history description: | The locally-stored Last.fm scrobble feed. Filter by artist/album/track (case-insensitive partial match) and/or a played-at window (`from`/`to`/`since`). Newest-first by default; paginate via `next_cursor`. operationId: getScrobblesGet parameters: - { name: artist, in: query, schema: { type: string } } - { name: album, in: query, schema: { type: string } } - { name: track, in: query, schema: { type: string } } - { name: from, in: query, description: ISO datetime — at or after., schema: { type: string, format: date-time }, } - { name: to, in: query, description: ISO datetime — at or before., schema: { type: string, format: date-time }, } - { name: since, in: query, description: Alias for `from`., schema: { type: string, format: date-time }, } - $ref: "#/components/parameters/SortOrder" - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 50 }, } - name: page in: query description: Offset-based page (legacy). Ignored when `cursor` is supplied. schema: { type: integer, minimum: 1, default: 1 } - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of scrobbles. content: application/json: schema: { $ref: "#/components/schemas/ScrobblesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Query Last.fm scrobble history (JSON body) operationId: getScrobblesPost requestBody: required: false content: application/json: schema: type: object properties: artist: { type: string } album: { type: string } track: { type: string } from: { type: string, format: date-time } to: { type: string, format: date-time } since: { type: string, format: date-time } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } cursor: { type: string } responses: "200": description: Page of scrobbles. content: application/json: schema: { $ref: "#/components/schemas/ScrobblesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/scrobble-stats: get: tags: [REST API] summary: Aggregate Last.fm scrobble metrics description: | Total play count, listening span (first/last played) and top artists/albums/tracks. Accepts the same filters as `/scrobbles`. operationId: getScrobbleStatsGet parameters: - { name: artist, in: query, schema: { type: string } } - { name: album, in: query, schema: { type: string } } - { name: track, in: query, schema: { type: string } } - { name: from, in: query, schema: { type: string, format: date-time } } - { name: to, in: query, schema: { type: string, format: date-time } } - { name: since, in: query, description: Alias for `from`., schema: { type: string, format: date-time }, } - { name: group_by, in: query, schema: { type: string, enum: [artist, album, track], default: artist }, } - { name: limit, in: query, description: Number of top results., schema: { type: integer, minimum: 1, maximum: 100, default: 20 }, } responses: "200": description: Aggregate scrobble metrics. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate Last.fm scrobble metrics (JSON body) operationId: getScrobbleStatsPost requestBody: required: false content: application/json: schema: type: object properties: artist: { type: string } album: { type: string } track: { type: string } from: { type: string, format: date-time } to: { type: string, format: date-time } since: { type: string, format: date-time } group_by: { type: string, enum: [artist, album, track], default: artist, } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } responses: "200": description: Aggregate scrobble metrics. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/scrobble-timeline: get: tags: [REST API] summary: Per-bucket Last.fm scrobble series description: | Play counts bucketed by **local** calendar day, week or month, broken down by artist, album or track, with per-entity metadata hoisted out of the buckets. Buckets are cut on `played_at AT TIME ZONE `, not on the UTC date: `played_at` is stored UTC and Norway runs UTC+2 in summer, so everything from 22:00 local onwards would otherwise be filed against the following day. See ADR 0059. Each bucket carries `plays` (its TRUE total, unaffected by `top_n` and `min_plays`), a precomputed `top` (taken from the raw counts, so it is never the overflow row and never changes with `top_n`; ties resolve by range-wide plays then alphabetically) and `entities`. The top-level `entities` block maps entity key to range-wide plays and a representative image for the whole range. REST defaults to `bucket=day` and `top_n=0`; the MCP tool `get_scrobble_timeline` defaults to `month` and `12` so a bare call fits a chat context. Those two defaults are the only difference between the surfaces. operationId: getScrobbleTimelineGet parameters: - name: artist in: query schema: { type: string } - name: album in: query schema: { type: string } - name: track in: query schema: { type: string } - name: from in: query description: "First bucket, inclusive, as a local calendar date in `timezone`. Defaults to the first day with matching scrobbles; an earlier value is pulled forward to it." schema: { type: string, format: date } - name: to in: query description: "Last bucket, inclusive, as a local calendar date in `timezone`. Defaults to today; a later value is pushed back to today, so the future is never reported as silence." schema: { type: string, format: date } - name: bucket in: query description: "Bucketing axis. Defaults to `day` on REST; the MCP tool defaults to `month`." schema: { type: string, enum: [day, week, month], default: day } - name: group_by in: query description: 'The entity stacked within each bucket. Album and track entities are keyed " - ", so same-titled records by different artists do not merge.' schema: { type: string, enum: [artist, album, track], default: artist } - name: top_n in: query description: "Per-bucket cap; 0 (the REST default) means every entity. Overflow is summed into one synthetic row whose key the response reports as `other_key`." schema: { type: integer, minimum: 0, maximum: 1000, default: 0 } - name: min_plays in: query description: "Drop entities below this many plays within a bucket. Dropped, not folded: the bucket's `plays` stays the true total, so `entities` then sums to less than it." schema: { type: integer, minimum: 1, maximum: 10000, default: 1 } - name: timezone in: query description: "IANA zone the calendar buckets are cut in. `played_at` is stored UTC; bucketing on UTC dates misfiles evening listening after 22:00 local in summer onto the next day. An unknown zone is a 400." schema: { type: string, default: Europe/Oslo } - name: include_empty_buckets in: query description: "Emit zero rows for silent buckets so a client need not reconstruct the gaps. A week of not listening is signal, not missing data." schema: { type: boolean, default: true } responses: "200": description: The bucketed series. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleTimelineResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Per-bucket Last.fm scrobble series (JSON body) operationId: getScrobbleTimelinePost requestBody: required: false content: application/json: schema: type: object properties: artist: { type: string } album: { type: string } track: { type: string } from: { type: string, format: date } to: { type: string, format: date } bucket: { type: string, enum: [day, week, month], default: day } group_by: { type: string, enum: [artist, album, track], default: artist, } top_n: { type: integer, minimum: 0, maximum: 1000, default: 0 } min_plays: { type: integer, minimum: 1, maximum: 10000, default: 1 } timezone: { type: string, default: Europe/Oslo } include_empty_buckets: { type: boolean, default: true } responses: "200": description: The bucketed series. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleTimelineResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/pages-timeline: get: tags: [REST API] summary: Pages read per day, week or month (StoryGraph) description: | Pages read per **local** calendar day, week (Monday-start) or month from Markus' StoryGraph reading journal, pulled from sidetal, broken down by book. See ADR 0062. A day's pages are the SUM of StoryGraph's own per-update `pages_read` deltas, never a difference of page positions. Journal dates are already the local day StoryGraph shows, so there is no `timezone` parameter and no conversion is applied. Deleted entries, undated entries and entries with no `pages_read` (started markers, percent-only updates) contribute nothing; `/api/v1/journal-entries` serves them. REST defaults to `bucket=day` and `top_n=0`; the MCP tool `get_pages_timeline` defaults to `week` and `5`. Those two defaults are the only difference between the surfaces. operationId: getPagesTimelineGet parameters: - name: from in: query description: "First day, inclusive (a local calendar day). Defaults to the first day with pages; an earlier value is pulled forward to it." schema: { type: string, format: date } - name: to in: query description: "Last day, inclusive. Defaults to today (Europe/Oslo); a later value is pushed back to today." schema: { type: string, format: date } - name: bucket in: query description: "Bucketing axis; weeks start on Monday. Defaults to `day` on REST; the MCP tool defaults to `week`." schema: { type: string, enum: [day, week, month], default: day } - name: book in: query description: "Only this book: the exact sidetal `book_id`, or a case-insensitive substring of the title." schema: { type: string } - name: top_n in: query description: "Per-bucket cap on the book breakdown; 0 (the REST default) means every book. Overflow is summed into one row whose key the response reports as `other_key`." schema: { type: integer, minimum: 0, maximum: 1000, default: 0 } - name: include_empty_buckets in: query description: "Emit zero rows for buckets with no reading. A day without reading is signal, not missing data." schema: { type: boolean, default: true } responses: "200": description: The bucketed series. content: application/json: schema: { $ref: "#/components/schemas/PagesTimelineResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Pages read per day, week or month (StoryGraph, JSON body) operationId: getPagesTimelinePost requestBody: required: false content: application/json: schema: type: object properties: from: { type: string, format: date } to: { type: string, format: date } bucket: { type: string, enum: [day, week, month], default: day } book: { type: string } top_n: { type: integer, minimum: 0, maximum: 1000, default: 0 } include_empty_buckets: { type: boolean, default: true } responses: "200": description: The bucketed series. content: application/json: schema: { $ref: "#/components/schemas/PagesTimelineResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/journal-entries: get: tags: [REST API] summary: Raw StoryGraph reading-journal entries description: | The StoryGraph journal entries behind `/api/v1/pages-timeline`, newest day first with undated entries last, including what the timeline leaves out: undated entries, started/finished markers and percent-only updates. Deleted entries are left out unless `include_deleted=true`. Follow `next_cursor` to page. See ADR 0062. operationId: getJournalEntriesGet parameters: - name: from in: query description: "Only entries on or after this local day. Excludes undated entries." schema: { type: string, format: date } - name: to in: query description: "Only entries on or before this local day. Excludes undated entries." schema: { type: string, format: date } - name: book in: query description: "Only this book: the exact sidetal `book_id`, or a case-insensitive substring of the title." schema: { type: string } - name: kind in: query schema: { type: string, enum: [progress, started, finished, percent, dnf] } - name: include_deleted in: query schema: { type: boolean, default: false } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 500, default: 50 } - name: cursor in: query description: "Opaque cursor from a previous response's `next_cursor`. A malformed one is a 400." schema: { type: string } responses: "200": description: One page of entries. content: application/json: schema: { $ref: "#/components/schemas/JournalEntriesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Raw StoryGraph reading-journal entries (JSON body) operationId: getJournalEntriesPost requestBody: required: false content: application/json: schema: type: object properties: from: { type: string, format: date } to: { type: string, format: date } book: { type: string } kind: { type: string, enum: [progress, started, finished, percent, dnf], } include_deleted: { type: boolean, default: false } limit: { type: integer, minimum: 1, maximum: 500, default: 50 } cursor: { type: string } responses: "200": description: One page of entries. content: application/json: schema: { $ref: "#/components/schemas/JournalEntriesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/youtube-watches: get: tags: [REST API] summary: Query YouTube watch history description: | ~96,500 YouTube watch events across two Google accounts, 2010-2026, from a Google Takeout-shaped export. Distinct from `/watched`, which serves the NeoDB catalogue of marked films/TV/books/games — this is the raw record of what was opened. One row per watch, so a rewatched video appears once per watch. Newest-first by default; paginate via `next_cursor`. Caveats that change the answer: - `duration_seconds` is the **video's length**, not how much was watched. No watch duration exists anywhere in this data. - Shorts dominate, and the flag is **derived here, not by YouTube**. Each row carries `is_short_method` and `is_short_source` saying how it was decided — a stored verdict, or the flat `duration < 180s` guess, which over-counts Shorts because they did not exist before September 2020 and were capped at 60s until 15 October 2024. `is_short` is `null` when nothing can decide it. - 11.4% of rows are unresolved (deleted/private): no title, no channel. The `channel` and `title` filters therefore cannot match them. - The two accounts overlap in time rather than succeeding one another. - Times are Europe/Oslo local wall clock at minute resolution. `watched_at_local` is the source's own value; `from`/`to`/`year` are read as local time and any timezone suffix on them is ignored. operationId: getYoutubeWatchesGet parameters: - { name: account, in: query, description: Exact account match., schema: { type: string }, } - { name: channel, in: query, description: "Channel name, case-insensitive partial match.", schema: { type: string }, } - { name: title, in: query, description: "Video title, case-insensitive partial match.", schema: { type: string }, } - { name: video_id, in: query, description: Exact 11-character YouTube video id., schema: { type: string }, } - { name: from, in: query, description: Local wall-clock datetime — at or after., schema: { type: string }, } - { name: to, in: query, description: Local wall-clock datetime — at or before (inclusive)., schema: { type: string }, } - { name: year, in: query, description: Calendar year in Europe/Oslo local time., schema: { type: integer }, } - $ref: "#/components/parameters/YoutubeShorts" - $ref: "#/components/parameters/YoutubeIncludeUnresolved" - $ref: "#/components/parameters/SortOrder" - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 50 }, } - name: page in: query description: Offset-based page (legacy). Ignored when `cursor` is supplied. schema: { type: integer, minimum: 1, default: 1 } - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of watch events. content: application/json: schema: { $ref: "#/components/schemas/YoutubeWatchesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Query YouTube watch history (JSON body) operationId: getYoutubeWatchesPost requestBody: required: false content: application/json: schema: type: object properties: account: { type: string } channel: { type: string } title: { type: string } video_id: { type: string } from: { type: string } to: { type: string } year: { type: integer } shorts: { type: string, enum: [include, exclude, only], default: include, } include_unresolved: { type: boolean, default: true } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } cursor: { type: string } responses: "200": description: Page of watch events. content: application/json: schema: { $ref: "#/components/schemas/YoutubeWatchesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/youtube-stats: get: tags: [REST API] summary: Aggregate YouTube watch metrics description: | Total watches, distinct videos and channels, first/last watch, and a breakdown by channel, year, month, day, weekday, hour_of_day, account or video. Accepts the same filters as `/youtube-watches`, so totals and first/last reflect only matching rows. Every response carries its own caveats, and they are not optional garnish: - `watch_time_estimates` returns **three** upper bounds (raw, capped at 20 minutes, Shorts-excluded) because this data contains no watch duration at all. `duration_coverage_pct` says what share of matching rows even had a length; the rest contribute zero to all three. - `shorts_split` separates **known from guessed**: the Shorts flag is derived here rather than supplied by YouTube, so quote a Shorts figure only alongside how much of it was actually decided. Unknowns stay their own bucket rather than being folded into either side. - `unresolved_watches` and `watches_without_channel` report how much of the result has no title or channel. - With `group_by=channel`, `excluded_from_ranking` states how many watches the ranking could not include. - `distinct_channels` counts channel **ids**, with `distinct_channel_names` beside it: a renamed channel has one id and two names. - `year`/`month`/`day`/`weekday`/`hour_of_day` come back in calendar order on Europe/Oslo local time; the others rank by watch count. `group_count` shows whether `limit` truncated the breakdown. `day` spans ~2,500 buckets archive-wide against a limit of 500, so scope it with `year` or `from`/`to`; `weekday` is ISO numbering, 1=Monday through 7=Sunday. - Every `top` bucket carries `distinct_videos`, `first_watch` and `last_watch` alongside its counts, so a per-channel lifecycle is one call rather than one call per channel. operationId: getYoutubeStatsGet parameters: - { name: account, in: query, schema: { type: string } } - { name: channel, in: query, schema: { type: string } } - { name: title, in: query, schema: { type: string } } - { name: video_id, in: query, schema: { type: string } } - { name: from, in: query, description: Local wall-clock datetime — at or after., schema: { type: string }, } - { name: to, in: query, description: Local wall-clock datetime — at or before (inclusive)., schema: { type: string }, } - { name: year, in: query, schema: { type: integer } } - $ref: "#/components/parameters/YoutubeShorts" - $ref: "#/components/parameters/YoutubeIncludeUnresolved" - { name: group_by, in: query, schema: { type: string, enum: [ channel, year, month, day, weekday, hour_of_day, account, video, ], default: channel, }, } - { name: limit, in: query, description: "Number of buckets. Raise it for month (~190 buckets), day (~366 per year) or hour_of_day (24).", schema: { type: integer, minimum: 1, maximum: 500, default: 20 }, } responses: "200": description: Aggregate watch metrics. content: application/json: schema: { $ref: "#/components/schemas/YoutubeStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate YouTube watch metrics (JSON body) operationId: getYoutubeStatsPost requestBody: required: false content: application/json: schema: type: object properties: account: { type: string } channel: { type: string } title: { type: string } video_id: { type: string } from: { type: string } to: { type: string } year: { type: integer } shorts: { type: string, enum: [include, exclude, only], default: include, } include_unresolved: { type: boolean, default: true } group_by: { type: string, enum: [ channel, year, month, day, weekday, hour_of_day, account, video, ], default: channel, } limit: { type: integer, minimum: 1, maximum: 500, default: 20 } responses: "200": description: Aggregate watch metrics. content: application/json: schema: { $ref: "#/components/schemas/YoutubeStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/convergence: get: tags: [REST API] summary: Scrobbles against train kilometres, and every time they have crossed description: Two monotonic counters over the same archive — one ticks up a play at a time, the other arrives in lumps of up to 1,176 km. Returns both totals, the signed gap (`total_km` minus `total_scrobbles`), who leads, the per-day rates over a trailing window, a projected next meeting, and the recorded crossings newest first. A crossing is either an `equality` (exactly level) or a `crossover` (the lead changed hands without ever being level, which only a kilometre lump can do). Kilometres are whole per leg, exactly as viaduct stores them, and a leg counts from the moment it departed rather than from a `Completed` status. operationId: getConvergence parameters: - { name: limit, in: query, description: "How many recorded crossings to return, newest first.", schema: { type: integer, minimum: 1, maximum: 100, default: 20 }, } - { name: pace_days, in: query, description: Trailing window the rates and the projection are computed over., schema: { type: integer, minimum: 1, maximum: 3650, default: 365 }, } responses: "200": description: The standing and the recorded crossings. content: application/json: schema: { $ref: "#/components/schemas/ConvergenceResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Scrobbles against train kilometres (JSON body) operationId: getConvergencePost requestBody: required: false content: application/json: schema: type: object properties: limit: { type: integer, minimum: 1, maximum: 100, default: 20 } pace_days: { type: integer, minimum: 1, maximum: 3650, default: 365 } responses: "200": description: The standing and the recorded crossings. content: application/json: schema: { $ref: "#/components/schemas/ConvergenceResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/scrobble-races: get: tags: [REST API] summary: Every configured scrobble race, with standings description: One entry per race defined in `races.json` — id, title, whether it is archived, its ntfy topic, both sides (an artist, an album or a track) with their exact play counts, the gap, and the result if the race has one. Pick a `race_id` here and ask `/scrobble-race` about it. An archived race is one already resolved — it stays queryable and the notifier skips it. operationId: listScrobbleRaces parameters: - { name: include_archived, in: query, description: Include races already resolved., schema: { type: boolean, default: true }, } responses: "200": description: The configured races. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleRacesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Every configured scrobble race, with standings (JSON body) operationId: listScrobbleRacesPost requestBody: required: false content: application/json: schema: type: object properties: include_archived: { type: boolean, default: true } responses: "200": description: The configured races. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleRacesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/scrobble-race: get: tags: [REST API] summary: Head-to-head standings for one scrobble race description: Exact all-time play counts for both sides of a race, the gap between them, plays needed to level and to overtake, plays/day over a trailing window, and a projected crossover date. A side is an artist, an album or a track. Pass `race_id` for a configured race (see `/scrobble-races`), or `leader` and `challenger` to race two artists ad hoc; with nothing passed it answers about the first unresolved configured race. Names are matched EXACTLY here, unlike `/scrobble-stats`, which does a substring match. Album and track sides need the POST form — a query string cannot carry an entity object. operationId: getScrobbleRace parameters: - { name: race_id, in: query, description: Id of a configured race — see /scrobble-races., schema: { type: string }, } - { name: leader, in: query, description: Exact artist name of the side in front., schema: { type: string }, } - { name: challenger, in: query, description: Exact artist name of the side catching up., schema: { type: string }, } - { name: pace_days, in: query, description: Trailing window used for plays/day and the projection., schema: { type: integer, minimum: 1, maximum: 3650, default: 90 }, } responses: "200": description: Current standings in the race. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleRaceResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Head-to-head standings between two artists (JSON body) operationId: getScrobbleRacePost requestBody: required: false content: application/json: schema: type: object properties: race_id: { type: string } leader: oneOf: - { type: string } - { $ref: "#/components/schemas/RaceEntity" } challenger: oneOf: - { type: string } - { $ref: "#/components/schemas/RaceEntity" } pace_days: { type: integer, minimum: 1, maximum: 3650, default: 90 } responses: "200": description: Current standings in the race. content: application/json: schema: { $ref: "#/components/schemas/ScrobbleRaceResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/post-breakouts: get: tags: [REST API] summary: Which posts are doing unusually well, relative to your own baseline description: | The state of the post-breakout notifier. For each watched account: where its own engagement bar sits (median / p90 / p99 over a rolling window, plus the all-time record), the thresholds a post must actually reach, which posts are armed to fire an alert right now, and which have already been announced. A post's score is `favourites*1 + reblogs*3 + replies*2` (configurable), and it is always the post's **peak** across its whole snapshot history rather than the latest reading — engagement counts go down, and a withdrawn favourite must not lower the bar or re-arm a spent rung. Baselines, thresholds and `armed` are computed live from the archive rather than read from the notifier's state, so this answers correctly even when notifications are unconfigured: `armed` non-empty with nothing arriving means the push is failing, not that nothing qualifies. `baseline.established` is false for an account with too few sampled posts for a percentile to mean anything — nothing fires there at all. NOTE: this endpoint serves public posts only, so its percentiles and lists are computed over public posts alone and can differ from the `get_post_breakouts` MCP tool, which sees the whole archive. operationId: getPostBreakouts parameters: - { name: actor_handle, in: query, description: Narrow to one account (@user@domain or an actor URL)., schema: { type: string }, } - { name: days, in: query, description: How far back the recent list of announced breakouts reaches., schema: { type: integer, minimum: 1, maximum: 365, default: 30 }, } - { name: limit, in: query, description: Maximum rows in recent and in each account's armed list., schema: { type: integer, minimum: 1, maximum: 200, default: 20 }, } responses: "200": description: Baselines, armed posts and announced breakouts. content: application/json: schema: { $ref: "#/components/schemas/PostBreakoutsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Which posts are doing unusually well (JSON body) operationId: getPostBreakoutsPost requestBody: required: false content: application/json: schema: type: object properties: actor_handle: { type: string } days: { type: integer, minimum: 1, maximum: 365, default: 30 } limit: { type: integer, minimum: 1, maximum: 200, default: 20 } responses: "200": description: Baselines, armed posts and announced breakouts. content: application/json: schema: { $ref: "#/components/schemas/PostBreakoutsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/now-playing: get: tags: [REST API] summary: Currently-playing Last.fm track description: | A live read of the Last.fm user's currently-playing track (not a stored scrobble). Returns `{ nowPlaying: false }` when Last.fm answered and nothing is playing, and `{ nowPlaying: null, error }` when the upstream call failed or Last.fm is not configured — an outage is never reported as silence. Successful reads are briefly cached server-side; failures are not. Note that this stays `false` mid-song for a scrobbler that never sends `track.updateNowPlaying`, which is the common case here. That is an honest read of an upstream that has nothing to report, not a bug. operationId: getNowPlayingGet responses: "200": description: Current now-playing state. content: application/json: schema: { $ref: "#/components/schemas/NowPlayingResponse" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Currently-playing Last.fm track (JSON body) operationId: getNowPlayingPost requestBody: required: false content: application/json: schema: { type: object } responses: "200": description: Current now-playing state. content: application/json: schema: { $ref: "#/components/schemas/NowPlayingResponse" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/train-trips: get: tags: [REST API] summary: Query train travel history description: | The locally-stored train trip feed (imported from viaduct.world CSV exports). Filter by `station` (origin or destination), `from_station`, `to_station`, `journey`, `operator`, `mode`, `status`, `tag`, `year`, or a departure `from`/`to` window. Newest-first by default; paginate via `next_cursor`. Each trip carries the IANA time zone of both ends (`fromTz`/`toTz`) and the geocoded station coordinates (`fromLat`/`fromLon`/`toLat`/`toLon`, null where a station is not geocoded yet). operationId: getTrainTripsGet parameters: - { name: station, in: query, description: Origin OR destination contains this., schema: { type: string }, } - { name: from_station, in: query, schema: { type: string } } - { name: to_station, in: query, schema: { type: string } } - { name: journey, in: query, schema: { type: string } } - { name: operator, in: query, schema: { type: string } } - { name: mode, in: query, description: e.g. Train or Ferry., schema: { type: string }, } - { name: status, in: query, description: e.g. Completed or Planned., schema: { type: string }, } - { name: tag, in: query, schema: { type: string } } - { name: year, in: query, schema: { type: integer } } - { name: from, in: query, description: ISO datetime — at or after., schema: { type: string, format: date-time }, } - { name: to, in: query, description: ISO datetime — at or before., schema: { type: string, format: date-time }, } - $ref: "#/components/parameters/SortOrder" - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 50 }, } - name: page in: query description: Offset-based page (legacy). Ignored when `cursor` is supplied. schema: { type: integer, minimum: 1, default: 1 } - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of trips. content: application/json: schema: { $ref: "#/components/schemas/TrainTripsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Query train travel history (JSON body) operationId: getTrainTripsPost requestBody: required: false content: application/json: schema: type: object properties: station: { type: string } from_station: { type: string } to_station: { type: string } journey: { type: string } operator: { type: string } mode: { type: string } status: { type: string } tag: { type: string } year: { type: integer } from: { type: string, format: date-time } to: { type: string, format: date-time } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } cursor: { type: string } responses: "200": description: Page of trips. content: application/json: schema: { $ref: "#/components/schemas/TrainTripsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/train-stats: get: tags: [REST API] summary: Aggregate train travel metrics description: | Total trip count, total distance (km), total time aboard, distinct stations/operators/journeys, travel span, a top-N breakdown (by journey, operator, mode or year), and the next upcoming planned trip. Accepts the journey/operator/mode/status/tag filters plus a `year` scope. operationId: getTrainStatsGet parameters: - { name: journey, in: query, schema: { type: string } } - { name: operator, in: query, schema: { type: string } } - { name: mode, in: query, schema: { type: string } } - { name: status, in: query, schema: { type: string } } - { name: tag, in: query, schema: { type: string } } - { name: year, in: query, description: Scope totals to this calendar year. Omit for all-time., schema: { type: integer }, } - { name: from, in: query, schema: { type: string, format: date-time } } - { name: to, in: query, schema: { type: string, format: date-time } } - { name: group_by, in: query, schema: { type: string, enum: [journey, operator, mode, year], default: journey, }, } - { name: limit, in: query, description: Number of top results., schema: { type: integer, minimum: 1, maximum: 100, default: 20 }, } responses: "200": description: Aggregate train metrics. content: application/json: schema: { $ref: "#/components/schemas/TrainStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate train travel metrics (JSON body) operationId: getTrainStatsPost requestBody: required: false content: application/json: schema: type: object properties: journey: { type: string } operator: { type: string } mode: { type: string } status: { type: string } tag: { type: string } year: { type: integer } from: { type: string, format: date-time } to: { type: string, format: date-time } group_by: { type: string, enum: [journey, operator, mode, year], default: journey, } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } responses: "200": description: Aggregate train metrics. content: application/json: schema: { $ref: "#/components/schemas/TrainStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/railway-lines: get: tags: [REST API] summary: The named railway lines and crossings description: | Every named railway line and fixed link the archive knows about: canonical name, aliases, countries, registry length, and whether Markus has travelled it — with trip count, on-line kilometres, crossing count and first/last traversal for the ones he has. The registry is curated by hand rather than derived from OpenStreetMap tagging, so this is also the list of what `/line-stats` can answer for. operationId: listRailwayLinesGet parameters: - { name: kind, in: query, description: "Restrict to railway lines, or to named bridges and tunnels.", schema: { type: string, enum: [line, crossing] }, } - { name: country, in: query, description: "ISO 3166-1 alpha-2 country code, e.g. NO, SE, GB.", schema: { type: string }, } - { name: travelled, in: query, description: "true for entries Markus has been on, false for the rest. Omit for both.", schema: { type: boolean }, } - { name: q, in: query, description: "Free-text filter over names and aliases.", schema: { type: string }, } - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 100 }, } responses: "200": description: The registry, with travel totals. content: application/json: schema: { $ref: "#/components/schemas/RailwayLinesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: The named railway lines and crossings (JSON body) operationId: listRailwayLinesPost requestBody: required: false content: application/json: schema: type: object properties: kind: { type: string, enum: [line, crossing] } country: { type: string } travelled: { type: boolean } q: { type: string } limit: { type: integer, minimum: 1, maximum: 200, default: 100 } responses: "200": description: The registry, with travel totals. content: application/json: schema: { $ref: "#/components/schemas/RailwayLinesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/line-stats: get: tags: [REST API] summary: Travel statistics for one railway line or crossing description: | Trips, on-line kilometres, time aboard, first and last traversal, and a breakdown by year, operator or journey — for a single named line. For a bridge or tunnel it returns a **crossing count**: each traversal counted once, in either direction, so an out-and-back day trip counts two. Names resolve through aliases, case and diacritics — `Bergensbanen`, `Bergen Line` and `bergensbana` are one line, as are `Öresundsbron`, `Øresundsbroen` and `Öresundsbroa`. An unknown name returns `404` with the closest registry matches rather than an empty result. Trips that have not departed are excluded from the totals and listed separately under `upcoming`, so the trip currently under way counts but next month's does not. Every response states coverage and names any pinned routing behind the numbers. operationId: getLineStatsGet parameters: - { name: line, in: query, required: true, description: "Line or crossing name; aliases, case and diacritics all resolve.", schema: { type: string }, } - { name: journey, in: query, schema: { type: string } } - { name: operator, in: query, schema: { type: string } } - { name: station, in: query, schema: { type: string } } - { name: mode, in: query, schema: { type: string } } - { name: status, in: query, schema: { type: string } } - { name: tag, in: query, schema: { type: string } } - { name: year, in: query, schema: { type: integer } } - { name: from, in: query, schema: { type: string, format: date-time } } - { name: to, in: query, schema: { type: string, format: date-time } } - { name: include_planned, in: query, description: "Include trips that have not departed yet. Off by default.", schema: { type: boolean, default: false }, } - { name: group_by, in: query, schema: { type: string, enum: [year, operator, journey], default: year }, } - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 20 }, } responses: "200": description: Aggregates for the line. content: application/json: schema: { $ref: "#/components/schemas/LineStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": description: No line of that name; the closest matches are returned. content: application/json: schema: { $ref: "#/components/schemas/LineNotFoundResponse" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Travel statistics for one railway line or crossing (JSON body) operationId: getLineStatsPost requestBody: required: true content: application/json: schema: type: object required: [line] properties: line: { type: string } journey: { type: string } operator: { type: string } station: { type: string } mode: { type: string } status: { type: string } tag: { type: string } year: { type: integer } from: { type: string, format: date-time } to: { type: string, format: date-time } include_planned: { type: boolean, default: false } group_by: { type: string, enum: [year, operator, journey], default: year, } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } responses: "200": description: Aggregates for the line. content: application/json: schema: { $ref: "#/components/schemas/LineStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": description: No line of that name; the closest matches are returned. content: application/json: schema: { $ref: "#/components/schemas/LineNotFoundResponse" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/line-trips: get: tags: [REST API] summary: The legs that touched a railway line or crossing description: | The individual legs behind `/line-stats`, each with its prorated on-line distance and duration, its share of the whole trip, and how the routing was decided — so a total can be audited leg by leg. Rows carry the unscaled registry kilometres (`raw_route_km`) and the `scale_factor` applied to reach the trip's recorded `distance_km`, plus the reason for any pinned routing. Crossing rows are marked `crossed` and sit outside the distance partition, because their kilometres are already counted inside their carrier line's. operationId: getLineTripsGet parameters: - { name: line, in: query, required: true, schema: { type: string } } - { name: journey, in: query, schema: { type: string } } - { name: operator, in: query, schema: { type: string } } - { name: station, in: query, schema: { type: string } } - { name: mode, in: query, schema: { type: string } } - { name: status, in: query, schema: { type: string } } - { name: tag, in: query, schema: { type: string } } - { name: year, in: query, schema: { type: integer } } - { name: from, in: query, schema: { type: string, format: date-time } } - { name: to, in: query, schema: { type: string, format: date-time } } - { name: include_planned, in: query, schema: { type: boolean, default: false }, } - { name: sort_order, in: query, schema: { type: string, enum: [asc, desc], default: desc }, } - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 50 }, } - { name: page, in: query, schema: { type: integer, minimum: 1, default: 1 }, } responses: "200": description: The legs that touched the line. content: application/json: schema: { $ref: "#/components/schemas/LineTripsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": description: No line of that name; the closest matches are returned. content: application/json: schema: { $ref: "#/components/schemas/LineNotFoundResponse" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: The legs that touched a railway line or crossing (JSON body) operationId: getLineTripsPost requestBody: required: true content: application/json: schema: type: object required: [line] properties: line: { type: string } journey: { type: string } operator: { type: string } station: { type: string } mode: { type: string } status: { type: string } tag: { type: string } year: { type: integer } from: { type: string, format: date-time } to: { type: string, format: date-time } include_planned: { type: boolean, default: false } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } responses: "200": description: The legs that touched the line. content: application/json: schema: { $ref: "#/components/schemas/LineTripsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": description: No line of that name; the closest matches are returned. content: application/json: schema: { $ref: "#/components/schemas/LineNotFoundResponse" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/trip-posts: get: tags: [REST API] summary: Posts made on a train trip description: | The posts made on a given train trip, and the trip a given post was made on — a derived join between the viaduct.world trips and the archived posts, matched on time. Each row carries the post plus its trip's stations, operator, rolling stock, distance and delay, and how the post relates to the trip: `boarding` (the 30 min before departure), `aboard`, or `alighting` (the 30 min after arrival). **Public posts only.** This endpoint serves posts the origin server marked public; followers-only, unlisted and unaddressed posts are withheld. The matching MCP tool returns the whole archive. See ADR 0026. operationId: getTripPostsGet parameters: - name: journey in: query description: Journey/trip name (case-insensitive, partial match). schema: { type: string } - name: station in: query description: Origin or destination station (case-insensitive, partial). schema: { type: string } - name: operator in: query schema: { type: string } - name: relation in: query description: How the post relates to the trip. schema: { type: string, enum: [boarding, aboard, alighting] } - name: tag in: query description: Hashtag, leading `#` optional — e.g. `togselfie`. schema: { type: string } - name: object_ap_id in: query description: Look up one post and return the trip it was made on. schema: { type: string } - name: year in: query schema: { type: integer } - name: from in: query schema: { type: string, format: date-time } - name: to in: query schema: { type: string, format: date-time } - name: with_media_only in: query schema: { type: boolean, default: false } - name: sort_order in: query schema: { type: string, enum: [asc, desc], default: desc } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 200, default: 50 } - name: page in: query schema: { type: integer, minimum: 1, default: 1 } responses: "200": description: Posts bound to trips. content: application/json: schema: { $ref: "#/components/schemas/TripPostsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Posts made on a train trip (JSON body) description: | The posts made on a given train trip, and the trip a given post was made on — a derived join between the viaduct.world trips and the archived posts, matched on time. Each row carries the post plus its trip's stations, operator, rolling stock, distance and delay, and how the post relates to the trip: `boarding` (the 30 min before departure), `aboard`, or `alighting` (the 30 min after arrival). **Public posts only.** This endpoint serves posts the origin server marked public; followers-only, unlisted and unaddressed posts are withheld. The matching MCP tool returns the whole archive. See ADR 0026. operationId: getTripPostsPost requestBody: required: true content: application/json: schema: type: object properties: journey: { type: string } station: { type: string } operator: { type: string } relation: { type: string, enum: [boarding, aboard, alighting] } tag: { type: string } object_ap_id: { type: string } year: { type: integer } from: { type: string, format: date-time } to: { type: string, format: date-time } with_media_only: { type: boolean, default: false } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } responses: "200": description: Posts bound to trips. content: application/json: schema: { $ref: "#/components/schemas/TripPostsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/trip-tracks: get: tags: [REST API] summary: Train routes as GeoJSON description: | The line each train trip drew on the map, from viaduct.world's GPX export, as a GeoJSON FeatureCollection. One `MultiLineString` Feature per leg, `[lon, lat]`; viaduct's segments are not in travel order and are kept as delivered. Properties carry the joined CSV trip (same stations and local departure time), null where there is none. Every response states `coverage`. See ADR 0070. operationId: getTripTracksGet parameters: - name: trip_id in: query description: A train trip id; returns that trip's route. schema: { type: string, format: uuid } - name: viaduct_trip_id in: query description: viaduct.world's own trip number, as in the GPX desc. schema: { type: string } - name: journey in: query description: Journey/trip name (case-insensitive, partial match). schema: { type: string } - name: station in: query description: Origin or destination station (case-insensitive, partial). schema: { type: string } - name: year in: query description: Calendar year of the local departure. schema: { type: integer } - name: matched in: query description: true for tracks joined to a stored trip, false for those with none. schema: { type: boolean } - name: near_lat in: query description: With near_lon, only legs whose route passes within near_km of this point. schema: { type: number, minimum: -90, maximum: 90 } - name: near_lon in: query description: With near_lat, only legs whose route passes within near_km of this point. schema: { type: number, minimum: -180, maximum: 180 } - name: near_km in: query description: Radius for near_lat/near_lon, in km. Route points are about 0.7 km apart. schema: { type: number, exclusiveMinimum: 0, maximum: 200, default: 5 } - name: with_geometry in: query description: false returns properties only, with null geometry. schema: { type: boolean, default: true } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 200, default: 20 } - name: page in: query schema: { type: integer, minimum: 1, default: 1 } responses: "200": description: Train routes as GeoJSON. content: application/json: schema: { $ref: "#/components/schemas/TripTracksResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Train routes as GeoJSON (JSON body) description: | The line each train trip drew on the map, from viaduct.world's GPX export, as a GeoJSON FeatureCollection. One `MultiLineString` Feature per leg, `[lon, lat]`; viaduct's segments are not in travel order and are kept as delivered. Properties carry the joined CSV trip (same stations and local departure time), null where there is none. Every response states `coverage`. See ADR 0070. operationId: getTripTracksPost requestBody: required: true content: application/json: schema: type: object properties: trip_id: { type: string, format: uuid } viaduct_trip_id: { type: string } journey: { type: string } station: { type: string } year: { type: integer } matched: { type: boolean } near_lat: { type: number, minimum: -90, maximum: 90 } near_lon: { type: number, minimum: -180, maximum: 180 } near_km: { type: number, exclusiveMinimum: 0, maximum: 200, default: 5, } with_geometry: { type: boolean, default: true } limit: { type: integer, minimum: 1, maximum: 200, default: 20 } page: { type: integer, minimum: 1, default: 1 } responses: "200": description: Train routes as GeoJSON. content: application/json: schema: { $ref: "#/components/schemas/TripTracksResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/station-discrepancies: get: tags: [REST API] summary: Stations where viaduct and the geocoder disagree description: | Where viaduct.world and the geocoder disagree about a station: every station a trip names, compared with viaduct's own waypoint of the same name from the GPX import (the nearest, when viaduct has two). Lists stations at least `min_km` apart, stations not geocoded that viaduct can place, and stations with no waypoint. Read-only. See ADR 0072. operationId: getStationDiscrepanciesGet parameters: - name: min_km in: query description: Flag a station at least this far from viaduct's waypoint. schema: { type: number, minimum: 0, default: 5 } - name: include_manual in: query description: Include stations pinned by hand. schema: { type: boolean, default: true } responses: "200": description: Stations compared with viaduct's waypoints. content: application/json: schema: { $ref: "#/components/schemas/StationDiscrepanciesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Stations where viaduct and the geocoder disagree (JSON body) description: | Where viaduct.world and the geocoder disagree about a station: every station a trip names, compared with viaduct's own waypoint of the same name from the GPX import (the nearest, when viaduct has two). Lists stations at least `min_km` apart, stations not geocoded that viaduct can place, and stations with no waypoint. Read-only. See ADR 0072. operationId: getStationDiscrepanciesPost requestBody: required: true content: application/json: schema: type: object properties: min_km: { type: number, minimum: 0, default: 5 } include_manual: { type: boolean, default: true } responses: "200": description: Stations compared with viaduct's waypoints. content: application/json: schema: { $ref: "#/components/schemas/StationDiscrepanciesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/viaduct-waypoints: get: tags: [REST API] summary: viaduct.world station waypoints description: | viaduct.world's own station positions from the GPX import, sorted by name. Two rows for one name is normal (metres apart). viaduct's answer, not the geocoder's. See ADR 0070. operationId: getViaductWaypointsGet parameters: - name: name in: query description: Station name (case-insensitive, partial match). schema: { type: string } responses: "200": description: viaduct.world's station waypoints. content: application/json: schema: { $ref: "#/components/schemas/ViaductWaypointsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: viaduct.world station waypoints (JSON body) description: | viaduct.world's own station positions from the GPX import, sorted by name. Two rows for one name is normal (metres apart). viaduct's answer, not the geocoder's. See ADR 0070. operationId: getViaductWaypointsPost requestBody: required: true content: application/json: schema: type: object properties: name: { type: string } responses: "200": description: viaduct.world's station waypoints. content: application/json: schema: { $ref: "#/components/schemas/ViaductWaypointsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/reading-stats: get: tags: [REST API] summary: Aggregate reading statistics description: | Total/average/median page counts, reading span, ratings distribution and a per-format breakdown for an actor's BookWyrm books, plus a top-N breakdown by year, month, format, author, rating, series or subject (subject is multi-valued — a book counts once per subject). Page/format/ year/series/subject data comes from cached BookWyrm Edition metadata; finish dates are derived from the actor's public statuses (a "read" comment or a review marks the finish). Defaults to the `read` shelf and `group_by=year`. Page averages are reported over books with known page counts (see `pages_coverage`); `avg_pages_prose` excludes comics/graphic novels and audiobooks. operationId: getReadingStatsGet parameters: - { name: actor_handle, in: query, required: true, schema: { type: string }, } - { name: status, in: query, schema: { type: string, enum: [reading, read, to-read, stopped-reading], default: read, }, } - { name: year, in: query, description: Scope to books finished in this calendar year. Omit for all-time., schema: { type: integer }, } - { name: from, in: query, schema: { type: string } } - { name: to, in: query, schema: { type: string } } - { name: format, in: query, schema: { type: string } } - { name: author, in: query, schema: { type: string } } - { name: rating, in: query, schema: { type: number } } - { name: group_by, in: query, schema: { type: string, enum: [year, month, format, author, rating, series, subject], default: year, }, } - { name: limit, in: query, description: Number of top results., schema: { type: integer, minimum: 1, maximum: 100, default: 20 }, } - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } responses: "200": description: Aggregate reading metrics. content: application/json: schema: { $ref: "#/components/schemas/ReadingStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate reading statistics (JSON body) operationId: getReadingStatsPost requestBody: required: true content: application/json: schema: type: object required: [actor_handle] properties: include_hidden: { type: boolean, default: false } actor_handle: { type: string } status: { type: string, enum: [reading, read, to-read, stopped-reading], default: read, } year: { type: integer } from: { type: string } to: { type: string } format: { type: string } author: { type: string } rating: { type: number } group_by: { type: string, enum: [year, month, format, author, rating, series, subject], default: year, } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } responses: "200": description: Aggregate reading metrics. content: application/json: schema: { $ref: "#/components/schemas/ReadingStatsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/reading-pace: get: tags: [REST API] summary: Reading pace and session analytics description: | Pace analytics over derived start→finish reading cycles (day granularity, from public statuses): per finished cycle `days_to_finish` and `pages_per_day`, reread detection (a book with multiple cycles), overlap periods where 2+ books were open at once, and summary aggregates (avg/median days to finish, avg pages/day, fastest/slowest, max concurrent books, `start_coverage`). Filter by `year`/`from`/`to` on the cycle's finish date. operationId: getReadingPaceGet parameters: - { name: actor_handle, in: query, required: true, schema: { type: string }, } - { name: year, in: query, description: Scope to cycles finished in this calendar year. Omit for all-time., schema: { type: integer }, } - { name: from, in: query, schema: { type: string } } - { name: to, in: query, schema: { type: string } } - { name: sort, in: query, schema: { type: string, enum: [finished, fastest, slowest], default: finished, }, } - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 50 }, } - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } responses: "200": description: Reading pace analytics. content: application/json: schema: { $ref: "#/components/schemas/ReadingPaceResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Reading pace and session analytics (JSON body) operationId: getReadingPacePost requestBody: required: true content: application/json: schema: type: object required: [actor_handle] properties: include_hidden: { type: boolean, default: false } actor_handle: { type: string } year: { type: integer } from: { type: string } to: { type: string } sort: { type: string, enum: [finished, fastest, slowest], default: finished, } limit: { type: integer, minimum: 1, maximum: 100, default: 50 } responses: "200": description: Reading pace analytics. content: application/json: schema: { $ref: "#/components/schemas/ReadingPaceResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/garden-pages: get: tags: [REST API] summary: List markus.plus "Tankehav" garden pages description: | Pages from the markus.plus "Tankehav" digital garden (an Obsidian Publish site): title, url, section, excerpt, image and an optional date per page, plus a section roll-up. Filter by `section`; dated pages sort by date, undated pages sort after alphabetically. Set `include_content=true` to also receive each page's full markdown text (`content`, frontmatter stripped; null when not yet synced — `content_missing` reports coverage). For a single page's full text (including the home page, path `/`, which this list omits) use `/garden-page`. operationId: getGardenPagesGet parameters: - name: section in: query description: Filter to one section (the first permalink segment, e.g. reisar, lesing, melding). schema: { type: string } - name: limit in: query schema: { type: integer, minimum: 1, maximum: 1000, default: 500 } - name: sort_order in: query schema: { type: string, enum: [asc, desc], default: desc } - name: include_content in: query description: Attach each page's full markdown text as `content` plus `content_fetched_at`. Responses can be large — filter by section or lower the limit when collecting incrementally. schema: { type: boolean, default: false } responses: "200": description: Garden pages with a section roll-up. content: application/json: schema: { $ref: "#/components/schemas/GardenPagesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: List markus.plus "Tankehav" garden pages (JSON body) operationId: getGardenPagesPost requestBody: required: false content: application/json: schema: type: object properties: section: { type: string } limit: { type: integer, minimum: 1, maximum: 1000, default: 500 } sort_order: { type: string, enum: [asc, desc], default: desc } include_content: { type: boolean, default: false } responses: "200": description: Garden pages with a section roll-up. content: application/json: schema: { $ref: "#/components/schemas/GardenPagesResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/garden-page: get: tags: [REST API] summary: Get one garden page with its full markdown text description: | One markus.plus "Tankehav" garden page resolved by `path` (the permalink, e.g. `/reisar/interrail/2025`; `/` is the home page) or `url`. Returns the page metadata plus `content` (the complete note body as markdown, frontmatter stripped) and `content_fetched_at`. Content is served from a local cache synced every 6h from Obsidian Publish; a missing page is fetched live once. `content` is null with `content_error` set if the source is currently unreachable. operationId: getGardenPageGet parameters: - name: path in: query description: Permalink path, e.g. /reisar/interrail/2025 (leading slash optional; "/" for the home page). schema: { type: string } - name: url in: query description: Full markus.plus URL. Alternative to path. schema: { type: string, format: uri } responses: "200": description: The garden page with its full text. content: application/json: schema: { $ref: "#/components/schemas/GardenPageResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get one garden page with its full markdown text (JSON body) operationId: getGardenPagePost requestBody: required: false content: application/json: schema: type: object properties: path: { type: string } url: { type: string, format: uri } responses: "200": description: The garden page with its full text. content: application/json: schema: { $ref: "#/components/schemas/GardenPageResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/books: get: tags: [REST API] summary: Browse all cached books description: | The cached BookWyrm book catalogue as a paginated list of compact rows (book_url, title, subtitle, author, series, pages, physical_format, isbn13/isbn10, pub_year, language, publisher, cover_url, subjects, shelf, shelves, fetched_at). Call `/book-details` for the full record (description, provenance) of one book. Filter by `title` (partial match), `author` (partial match), `format`, `language`, `series` (partial match), `subject` (partial match against any subject/genre), or `shelf`. **This endpoint is a per-edition bibliographic cache, not a shelf.** Unfiltered it returns every book ever enriched — including ones still being read and ones started and put down. Pass `shelf=read` for finished books only. A `shelf` filter returns 404 rather than an empty page when shelf membership has not been synced yet, because an empty page cannot be told apart from "no books are on that shelf". Most-recently-enriched first by default; each response carries `total` (matching books across all pages) and a `next_cursor` for deep traversal. operationId: getBooksGet parameters: - name: title in: query description: Case-insensitive partial title match. schema: { type: string } - name: author in: query description: Case-insensitive partial author match. schema: { type: string } - name: format in: query description: Exact physical_format, e.g. Paperback, Hardcover, GraphicNovel, AudiobookFormat. schema: { type: string } - name: language in: query description: Exact language (normalized ISO-639-1 code, e.g. en, no). schema: { type: string } - name: series in: query description: Case-insensitive partial series-name match. schema: { type: string } - name: subject in: query description: Case-insensitive partial match against any of the book's subjects. schema: { type: string } - name: shelf in: query description: >- Books a tracked BookWyrm actor currently has on this shelf. `stopped-reading` is the ones started and put down without finishing; `unknown` is the inverse of all four — cached editions with no live shelf membership. Omit for every cached book regardless of shelf. schema: { type: string, enum: [read, reading, to-read, stopped-reading, unknown], } - $ref: "#/components/parameters/SortOrder" - name: limit in: query schema: { type: integer, minimum: 1, maximum: 200, default: 50 } - name: page in: query description: Offset-based page (legacy). Ignored when `cursor` is supplied. schema: { type: integer, minimum: 1, default: 1 } - $ref: "#/components/parameters/Cursor" - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } responses: "200": description: Page of books. content: application/json: schema: { $ref: "#/components/schemas/BooksResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Browse all cached books (JSON body) operationId: getBooksPost requestBody: required: false content: application/json: schema: type: object properties: include_hidden: { type: boolean, default: false } title: { type: string } author: { type: string } format: { type: string } language: { type: string } series: { type: string } subject: { type: string } shelf: { type: string, enum: [read, reading, to-read, stopped-reading, unknown], } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } cursor: { type: string } responses: "200": description: Page of books. content: application/json: schema: { $ref: "#/components/schemas/BooksResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/watched: get: tags: [REST API] summary: Browse the cached NeoDB catalogue (all categories) description: | The cached NeoDB catalogue as a paginated list — every item behind this server's stored NeoDB marks ("finished watching …", "played …", "listened to …", "read …"), enriched from the catalog item the mark only links to. Covers ALL categories, filter with `category`: tv, movie, book, music, game, podcast, performance. Common fields on every row (item_url, category, item_type, title/display_title/orig_title, mark_titles, mark_comments, year, cover_url, description, genre, language, area, rating, external_resources, fetched_at); film/TV columns (season_number, episode_count, imdb + imdb_url, tmdb_url, director, actors); and a per-category `details` object (book author/isbn/pages/ publisher + bookwyrm_book_url; music artist/release_date/track_count/barcode; game developer/publisher/platform; podcast host/feed_url; performance playwright/director/troupe/venue/opening_date). Filter by `title` (partial, matches the enriched title and the mark-supplied `mark_titles` aliases), `category`, `item_type`, `genre` (partial), exact `imdb` id, or `mark_comment` (partial, against the note(s) the mark(s) carried); `include_unenriched=true` also returns pending/failed rows (with fetch_error/ fetch_attempts). Every row carries the shelf date — `watched_at` (when it was actually watched/read/played/listened to, NOT the post timestamp) and `watched_dates` (every distinct date across the item's live marks, newest first) — filterable with `watched_from`/`watched_to` or the `watched_year` sugar, and sortable with `sort_by=watched_at`. `watched_date_unknown` is true for a title marked as seen with the date explicitly unknown (dated 2000-01-01 on minreol, the sentinel this server decodes): its `watched_at` is null on purpose and it belongs to no watch year; `watched_date_unknown=true` lists those, `=false` drops them. Most-recently-enriched first by default; each response carries `total` and a `next_cursor`. Use /catalogue-details for one item's full record + provenance. operationId: getWatchedGet parameters: - name: title in: query description: Case-insensitive partial title match. schema: { type: string } - name: category in: query description: Exact NeoDB category, e.g. tv, movie, book, music, game, podcast, performance. schema: { type: string } - name: item_type in: query description: Exact AP object type, e.g. Movie, TVSeason, Edition, Album, Game, Podcast, Performance. schema: { type: string } - name: genre in: query description: Case-insensitive partial match against any of the title's genres. schema: { type: string } - name: imdb in: query description: Exact IMDb id, e.g. tt27579939 (film/TV only). schema: { type: string } - name: mark_comment in: query description: > Case-insensitive substring match against the note(s) the mark(s) carried, e.g. "kino" finds everything marked "Sett på kino.". Free text — never parsed into categories. schema: { type: string } - name: status in: query description: > Only items whose NEWEST live mark carries this status. Positive, so it REQUIRES a tracked mark: an item enriched before the mark store existed has no status and is not returned. For "only what I actually finished", prefer `exclude_status`. schema: { type: string, enum: [wishlist, progress, complete, dropped] } - name: exclude_status in: query description: > Comma-separated statuses to drop, e.g. `dropped,progress`. Items with no tracked mark are KEPT — this removes only what is positively known, which is the safe direction given the mark store does not cover every enriched item. schema: { type: array, items: { type: string } } style: form explode: false - name: watched_from in: query description: > Only items with a mark watched/read/played on or after this date. `YYYY-MM-DD` anchors to that day's start in UTC; a full ISO timestamp is used verbatim. An item matches if ANY of its live marks falls in the window. schema: { type: string } - name: watched_to in: query description: > Only items with a mark watched/read/played on or before this date. `YYYY-MM-DD` covers that whole day in UTC (the bound is pushed to the following midnight, exclusive); a full ISO timestamp is compared inclusively. schema: { type: string } - name: watched_year in: query description: > Sugar for `watched_from`/`watched_to` spanning one calendar year in UTC, e.g. 2016 for "everything I watched in 2016". An explicit bound overrides it on that edge. schema: { type: integer, minimum: 1000, maximum: 9999 } - name: watched_date_unknown in: query description: > `true` keeps only titles marked as seen with the date explicitly unknown (the 2000-01-01 sentinel on minreol; their `watched_at` is null and they belong to no watch year, so combining `true` with a date window always returns nothing). `false` drops them, keeping titles with no tracked mark at all. Omit for both. schema: { type: boolean } - name: include_unenriched in: query description: Include rows not yet successfully enriched (pending/failed, carrying fetch_error/fetch_attempts). schema: { type: boolean, default: false } - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } - name: sort_by in: query description: > Which timestamp to order by. `fetched_at` (default) is enrichment time — for a backfilled import that is only the order the import ran in. `watched_at` orders by the item's newest shelf date; items with no date sort last in both directions. schema: { type: string, enum: [fetched_at, watched_at], default: fetched_at, } - $ref: "#/components/parameters/SortOrder" - name: limit in: query schema: { type: integer, minimum: 1, maximum: 200, default: 50 } - name: page in: query description: Offset-based page (legacy). Ignored when `cursor` is supplied. schema: { type: integer, minimum: 1, default: 1 } - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of catalogue items. content: application/json: schema: { $ref: "#/components/schemas/WatchedResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Browse the cached NeoDB catalogue (JSON body) operationId: getWatchedPost requestBody: required: false content: application/json: schema: type: object properties: title: { type: string } category: { type: string } item_type: { type: string } genre: { type: string } imdb: { type: string } mark_comment: { type: string } status: { type: string, enum: [wishlist, progress, complete, dropped], } exclude_status: { type: array, items: { type: string } } watched_from: { type: string } watched_to: { type: string } watched_year: { type: integer, minimum: 1000, maximum: 9999 } watched_date_unknown: { type: boolean } include_unenriched: { type: boolean, default: false } include_hidden: { type: boolean, default: false } sort_by: { type: string, enum: [fetched_at, watched_at], default: fetched_at, } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } cursor: { type: string } responses: "200": description: Page of catalogue items. content: application/json: schema: { $ref: "#/components/schemas/WatchedResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/gigs: get: tags: [REST API] summary: Browse the concert log description: | The concert log as a paginated list — every gig behind this server's stored Gigowl (gigowl.social) attendances, enriched from the concert record the federated Note only links to. **Two dates, never interchangeable.** `gig_date` is the night of the gig and is what you almost always want; `logged_at` is when the attendance was posted, which for an imported archive is only the order the import ran in. A 2022 gig entered in 2026 has `gig_date` 2022 and `logged_at` 2026. `sort_by` defaults to `gig_date`, newest first. **RSVP state.** `rsvp_status` is interested/going/attended and `status_source` says where it came from: `tag` or `property` means the origin published it as data, `template` means it was read off the generated opening sentence — all that attendances logged before the origin published it as data carry. A state the parser did not recognise is null rather than a guess. **Setlists** are only ever as complete as the origin serves them: `song_count` is null for a gig nobody recorded one for, which is not the same as a gig with no songs. Filter with `has_setlist` and search within them with `song`. Each response carries `total` and a `next_cursor`. Use /gig-details for one gig's full record including its setlist, and /gig-stats for aggregates. operationId: getGigsGet parameters: - name: artist in: query description: Case-insensitive partial match against any name in the line-up, support acts included. schema: { type: string } - name: venue in: query description: Case-insensitive partial venue-name match. schema: { type: string } - name: city in: query description: Case-insensitive partial city match. schema: { type: string } - name: country in: query description: ISO 3166-1 alpha-2 country code, case-insensitive exact. schema: { type: string } - name: festival in: query description: Case-insensitive partial festival-name match. A festival day is an ordinary gig with many artists. schema: { type: string } - name: tour in: query description: Case-insensitive partial tour-name match. schema: { type: string } - name: song in: query description: Only gigs whose setlist contains this song (case-insensitive partial). A gig with no setlist can never match. schema: { type: string } - name: q in: query description: Free-text search over the gig title, its notes and any write-up about it. schema: { type: string } - name: status in: query description: RSVP state. Check `status_source` on the results before treating it as stated fact. schema: { type: string, enum: [interested, going, attended] } - name: concert_status in: query description: The concert's own status, which is about the event and not about attending it. schema: { type: string, enum: [scheduled, cancelled, postponed, completed] } - name: year in: query description: Sugar for from/to spanning one calendar year, on the NIGHT of the gig. schema: { type: integer, minimum: 1000, maximum: 9999 } - name: from in: query description: Only gigs on or after this date (YYYY-MM-DD), by the night of the gig. schema: { type: string, format: date } - name: to in: query description: Only gigs on or before this date (YYYY-MM-DD), by the night of the gig. schema: { type: string, format: date } - name: has_review in: query description: Only gigs somebody wrote up. schema: { type: boolean, default: false } - name: has_setlist in: query description: Only gigs with at least one song recorded. schema: { type: boolean, default: false } - name: include_unenriched in: query description: Include rows whose concert record has not been fetched successfully yet. Such a row has no title, date or line-up. schema: { type: boolean, default: false } - name: include_hidden in: query description: Include gigs an admin has hidden from the served catalogue. schema: { type: boolean, default: false } - name: sort_by in: query description: > Which date to order by. `gig_date` (default) is the night of the gig; `logged_at` is when the attendance was posted. Gigs with no date sort last in both directions. schema: { type: string, enum: [gig_date, logged_at], default: gig_date } - $ref: "#/components/parameters/SortOrder" - name: limit in: query schema: { type: integer, minimum: 1, maximum: 200, default: 50 } - name: page in: query description: Offset-based page (legacy). Ignored when `cursor` is supplied. schema: { type: integer, minimum: 1, default: 1 } - $ref: "#/components/parameters/Cursor" responses: "200": description: Page of gigs. content: application/json: schema: { $ref: "#/components/schemas/GigsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Browse the concert log (JSON body) operationId: getGigsPost requestBody: required: false content: application/json: schema: type: object properties: artist: { type: string } venue: { type: string } city: { type: string } country: { type: string } festival: { type: string } tour: { type: string } song: { type: string } q: { type: string } status: { type: string, enum: [interested, going, attended] } concert_status: { type: string, enum: [scheduled, cancelled, postponed, completed], } year: { type: integer, minimum: 1000, maximum: 9999 } from: { type: string, format: date } to: { type: string, format: date } has_review: { type: boolean, default: false } has_setlist: { type: boolean, default: false } include_unenriched: { type: boolean, default: false } include_hidden: { type: boolean, default: false } sort_by: { type: string, enum: [gig_date, logged_at], default: gig_date, } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } cursor: { type: string } responses: "200": description: Page of gigs. content: application/json: schema: { $ref: "#/components/schemas/GigsResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/gig-details: get: tags: [REST API] summary: Get one gig's full record description: | One gig, resolved by `concert_url` (exact) or a partial `title` (the most recent match wins). Everything /gigs returns, plus the complete `setlists` array (per artist; each entry with position, setNumber, isEncore, songTitle, isCover, coverOfArtist and note — encores and covers are the two things a setlist is read for), the venue's own catalogue record when it has been fetched (aka names, coordinates, capacity, timezone, wikidata_qid, is_placeholder — a placeholder venue means the venue was genuinely not announced, not that data is missing), `source_map` (per-field provenance: `samklang-ap` or `samklang-jsonld`; the ActivityPub representation is the more complete of the two and wins wherever it spoke), and enrichment status. operationId: getGigDetailsGet parameters: - name: concert_url in: query description: The gig's canonical URL, exactly as /gigs returns it. schema: { type: string } - name: title in: query description: Alternatively, a case-insensitive partial title match. schema: { type: string } - name: include_hidden in: query description: Allow resolving a gig an admin has hidden. schema: { type: boolean, default: false } responses: "200": description: The gig's full record, or an `error` field when nothing matched. content: application/json: schema: { $ref: "#/components/schemas/GigDetails" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get one gig's full record (JSON body) operationId: getGigDetailsPost requestBody: required: false content: application/json: schema: type: object properties: concert_url: { type: string } title: { type: string } include_hidden: { type: boolean, default: false } responses: "200": description: The gig's full record, or an `error` field when nothing matched. content: application/json: schema: { $ref: "#/components/schemas/GigDetails" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/gig-stats: get: tags: [REST API] summary: Aggregate the concert log description: | Totals (gigs, distinct artists/venues/cities/countries, first and last gig, gigs carrying a setlist or a write-up, songs on record) plus breakdowns `by_status`, `by_year` (by the night of the gig), `top_artists`, `top_venues`, `top_cities` and `top_songs`. `top_songs` and `songs_played` count only what a setlist records, so they are "songs I have a record of", never "songs I heard" — a gig nobody wrote a setlist for contributes nothing. Artist and venue totals are keyed on NAME, so two artists sharing a name count once. operationId: getGigStatsGet parameters: - name: status in: query description: Count only gigs with this RSVP state. schema: { type: string, enum: [interested, going, attended] } - name: from in: query schema: { type: string, format: date } - name: to in: query schema: { type: string, format: date } - name: year in: query description: Sugar for from/to spanning one calendar year. schema: { type: integer, minimum: 1000, maximum: 9999 } - name: top in: query description: How many entries in each of the top-N breakdowns. schema: { type: integer, minimum: 1, maximum: 50, default: 10 } - name: include_hidden in: query schema: { type: boolean, default: false } responses: "200": description: Aggregate view of the concert log. content: application/json: schema: { $ref: "#/components/schemas/GigStats" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate the concert log (JSON body) operationId: getGigStatsPost requestBody: required: false content: application/json: schema: type: object properties: status: { type: string, enum: [interested, going, attended] } from: { type: string, format: date } to: { type: string, format: date } year: { type: integer, minimum: 1000, maximum: 9999 } top: { type: integer, minimum: 1, maximum: 50, default: 10 } include_hidden: { type: boolean, default: false } responses: "200": description: Aggregate view of the concert log. content: application/json: schema: { $ref: "#/components/schemas/GigStats" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/theatre: get: tags: [REST API] summary: Browse the theatre log description: | Every NeoDB (minreol) mark on a play (`Performance`) or on one staging of it (`PerformanceProduction`), one row per **visit**, newest night first. `seen_at` is the night, the shelf date. `marked_at` is when the mark was posted. `seen_date_unknown: true` means it was seen on a date nobody knows (minreol's 2000-01-01 sentinel): `seen_at` is then null and the visit belongs to no year. Wishlist marks are left out unless `status=wishlist` is asked for. `troupe` comes from NeoDB's credits; `venue` only when NeoDB records one, which a touring production often does not. Use /theatre-details for one play in full and /theatre-stats for aggregates. operationId: getTheatreGet parameters: - { name: title, in: query, description: Case-insensitive partial title match., schema: { type: string }, } - { name: troupe, in: query, description: Case-insensitive partial troupe match., schema: { type: string }, } - { name: venue, in: query, description: Case-insensitive partial venue match., schema: { type: string }, } - { name: person, in: query, description: "Anyone credited, the troupe included.", schema: { type: string }, } - { name: q, in: query, description: "Free text over title, description and the comment.", schema: { type: string }, } - { name: status, in: query, schema: { type: string, enum: [wishlist, progress, complete, dropped] }, } - { name: item_type, in: query, schema: { type: string, enum: [Performance, PerformanceProduction] }, } - { name: year, in: query, schema: { type: integer, minimum: 1000, maximum: 9999 }, } - { name: from, in: query, schema: { type: string, format: date } } - { name: to, in: query, schema: { type: string, format: date } } - { name: seen_date_unknown, in: query, schema: { type: boolean } } - { name: has_comment, in: query, schema: { type: boolean, default: false }, } - { name: include_hidden, in: query, schema: { type: boolean, default: false }, } - { name: sort_by, in: query, schema: { type: string, enum: [seen_at, marked_at], default: seen_at }, } - { name: sort_order, in: query, schema: { type: string, enum: [asc, desc], default: desc }, } - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 50 }, } - { name: page, in: query, schema: { type: integer, minimum: 1, default: 1 }, } - { name: cursor, in: query, schema: { type: string } } responses: "200": description: A page of theatre visits. content: application/json: schema: { $ref: "#/components/schemas/TheatreResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/theatre-details: get: tags: [REST API] summary: Get one play or production in full description: | Resolved by `item_url` (exact) or a partial `title` (the most recently seen match wins). Returns the newest visit's fields, every visit to it, and the link between a play and its stagings: `play` for a production, `productions` for a play. operationId: getTheatreDetailsGet parameters: - { name: item_url, in: query, schema: { type: string } } - { name: title, in: query, schema: { type: string } } - { name: include_hidden, in: query, schema: { type: boolean, default: false }, } responses: "200": description: The play's full record, or an `error` field when nothing matched. content: application/json: schema: { $ref: "#/components/schemas/TheatreDetails" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/theatre-stats: get: tags: [REST API] summary: Aggregate the theatre log description: | Totals (visits, distinct plays, productions, visits with a comment, visits on an unknown date, undated, first and last night) plus `by_year` (by the night), `by_status`, `top_troupes`, `top_venues`, `top_playwrights`, `top_original_creators`, `top_directors` and `top_actors`. Names are keyed on the name, so two people sharing a name count once. operationId: getTheatreStatsGet parameters: - { name: status, in: query, schema: { type: string, enum: [wishlist, progress, complete, dropped] }, } - { name: from, in: query, schema: { type: string, format: date } } - { name: to, in: query, schema: { type: string, format: date } } - { name: year, in: query, schema: { type: integer, minimum: 1000, maximum: 9999 }, } - { name: top, in: query, schema: { type: integer, minimum: 1, maximum: 50, default: 10 }, } - { name: include_hidden, in: query, schema: { type: boolean, default: false }, } responses: "200": description: Aggregate view of the theatre log. content: application/json: schema: { $ref: "#/components/schemas/TheatreStats" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/catalogue-details: get: tags: [REST API] summary: Get one NeoDB catalogue item's full record description: | One NeoDB catalogue item's full cached record, resolved by `item_url` (exact) or a partial `title` (most-recently-enriched wins; pass `category` to disambiguate). Returns the common fields, `watched_at`/`watched_dates` (the shelf date(s) — when it was watched/read/played, not when the mark was posted) and `watched_date_unknown` (true when it was marked as seen with the date explicitly unknown, so `watched_at` is null on purpose), film/TV columns, the category-specific `details` object, `bookwyrm_book_url` (book↔BookWyrm dedup link), `source_map` (per-field 'neodb'|'bookwyrm' provenance), and enrichment status (fetched_at, fetch_error, fetch_attempts, last_attempt_at). The catalogue sibling of /book-details. operationId: getCatalogueDetailsGet parameters: - name: item_url in: query description: NeoDB catalog URL (exact match, the primary key). schema: { type: string } - name: title in: query description: Case-insensitive partial title match (most-recently-enriched wins). schema: { type: string } - name: category in: query description: Optional category filter to disambiguate a title match. schema: { type: string } - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } responses: "200": description: The catalogue item's full record. content: application/json: schema: { $ref: "#/components/schemas/CatalogueDetails" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get one NeoDB catalogue item's full record (JSON body) operationId: getCatalogueDetailsPost requestBody: required: false content: application/json: schema: type: object properties: include_hidden: { type: boolean, default: false } item_url: { type: string } title: { type: string } category: { type: string } responses: "200": description: The catalogue item's full record. content: application/json: schema: { $ref: "#/components/schemas/CatalogueDetails" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "404": { $ref: "#/components/responses/NotFound" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/book-details: get: tags: [REST API] summary: Get enriched metadata for one book description: | Full enriched metadata for one BookWyrm book from the local cache, resolved by `book_url` (the Edition AP id), `isbn` (13 or 10), or a partial `title`. Returns title, subtitle, author, series, pages, physical_format, isbn13/isbn10, pub_year, language, original_language, publisher, cover_url, description and subjects — each matched to the edition's resolved ISBN — plus isbn_source/page_source/source_map provenance. Provide at least one of book_url, isbn, or title. operationId: getBookDetailsGet parameters: - name: book_url in: query description: BookWyrm Edition AP id (exact match). schema: { type: string } - name: isbn in: query description: ISBN-13 or ISBN-10 (hyphens/spaces ignored). schema: { type: string } - name: title in: query description: Case-insensitive partial title match. schema: { type: string } - name: include_hidden in: query description: Include rows an admin has hidden from the served catalogue. Off by default. Hidden rows still exist and are still enriched; they are suppressed from listings, not deleted. schema: { type: boolean, default: false } responses: "200": description: The enriched book metadata record, or an error object when not found. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get enriched metadata for one book (JSON body) operationId: getBookDetailsPost requestBody: required: false content: application/json: schema: type: object properties: include_hidden: { type: boolean, default: false } book_url: { type: string } isbn: { type: string } title: { type: string } responses: "200": description: The enriched book metadata record, or an error object when not found. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/linkedin-posts: get: tags: [REST API] summary: Query LinkedIn posts with their latest performance numbers description: | Markus' LinkedIn archive. Post text, visibility and attached link come from LinkedIn's DMA Member Snapshot API (polled); impressions and engagements come from a monthly `.xlsx` export, joined on the post id. Neither source is a subset of the other, so a post may have text and no numbers yet (`latest_metrics: null`) or numbers and no text (`has_content: false`). `latest_metrics` carries the MOST RECENT export's figures, not a lifetime total — the export's impressions are a windowed accumulation. Use `/api/v1/linkedin-post` for the full observation series. `engagement_rate` is computed, not stored, and is null when impressions are 0 or engagements are unknown. Filter by publish date with `from`/`to` (calendar days, Europe/Oslo), by `visibility`, and by `has_metrics`. The archive is small, so paging is plain `page`/`limit` offsets with no cursor. REST serves publicly-visible posts only (ADR 0026); MCP sees the whole archive. operationId: getLinkedinPostsGet parameters: - { name: from, in: query, description: Published on or after this date., schema: { type: string, format: date }, } - { name: to, in: query, description: Published on or before this date., schema: { type: string, format: date }, } - { name: since, in: query, description: Alias for from., schema: { type: string, format: date }, } - { name: visibility, in: query, description: "LinkedIn's own visibility string, e.g. PUBLIC.", schema: { type: string }, } - { name: has_metrics, in: query, description: true for posts with imported numbers; false for those still awaiting an export., schema: { type: boolean }, } - $ref: "#/components/parameters/SortOrder" - { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 200, default: 50 }, } - { name: page, in: query, schema: { type: integer, minimum: 1, default: 1 }, } responses: "200": description: Matching posts with their latest metrics attached. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Query LinkedIn posts (JSON body) operationId: getLinkedinPostsPost requestBody: required: false content: application/json: schema: type: object properties: from: { type: string, format: date } to: { type: string, format: date } since: { type: string, format: date } visibility: { type: string } has_metrics: { type: boolean } sort_order: { type: string, enum: [asc, desc], default: desc } limit: { type: integer, minimum: 1, maximum: 200, default: 50 } page: { type: integer, minimum: 1, default: 1 } responses: "200": description: Matching posts with their latest metrics attached. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/linkedin-post: get: tags: [REST API] summary: Get one LinkedIn post with its full metric history description: | One post, resolved by `url` in either form LinkedIn uses — the `/feed/update/urn:li:activity:` permalink or the `/posts/-ugcPost--` share link — or by the bare numeric `post_key`. All reduce to the same post. `metrics_history` is one row per monthly export, oldest first. Because the export's impressions are a windowed accumulation rather than a lifetime total, successive rows are genuinely different observations and the series is a reach-decay curve: a later row with fewer impressions means the post stopped being served, not that the earlier figure was wrong. Provide at least one of url or post_key. REST serves publicly-visible posts only. operationId: getLinkedinPostGet parameters: - { name: url, in: query, description: "The post URL, in either LinkedIn form.", schema: { type: string }, } - { name: post_key, in: query, description: The numeric activity id., schema: { type: string }, } responses: "200": description: The post with its metric history, or an error object when not found. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Get one LinkedIn post (JSON body) operationId: getLinkedinPostPost requestBody: required: false content: application/json: schema: type: object properties: url: { type: string } post_key: { type: string } responses: "200": description: The post with its metric history, or an error object when not found. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/linkedin-stats: get: tags: [REST API] summary: Aggregate LinkedIn performance, including median engagement rate per weekday description: | Totals, the p25/p75 spread for impressions and engagement rate, and `by_weekday` — the median engagement rate per weekday, which is the figure to use when reasoning about posting times. Medians rather than means, because one viral post otherwise decides the ranking; computed over each post's LATEST observation only, so a post that stayed in the top 50 for four months counts once rather than four times; bucketed by weekday in `Europe/Oslo`, so a post published at 00:30 CEST is not filed under the previous day. Every `by_weekday` bucket reports `n` (posts with a usable rate) beside its medians — a weekday can rest on one or two posts, and a ranking that ignores `n` will overstate what the data supports. `source_health` reports the state of the ingest. `ok` — data is flowing. `stale` / `unauthorized` — the numbers STOPPED moving at `last_success_at`, so a recent dip describes the outage rather than the audience. `awaiting_data` — the poller works but LinkedIn has never yet handed over the posts, so the numbers never STARTED: a thin result means the ingest has not begun. `never_run` — the poller is not configured. `last_data_at` is when posts actually last arrived, a different question from when the job last ran. `last_note`, `last_http_status` and `last_http_body` are written on every attempt, not only on failures — `last_error` and `last_status` stay empty while a source succeeds and returns nothing, which is precisely the state `awaiting_data` describes. `last_note` says what the run concluded and on what evidence, including the control-domain probe that separates a refused token from a collation delay. `join_health` reports whether the two halves are meeting. Content and performance are joined on an id extracted from each source's own URL spelling, so a namespace mismatch fills both tables and joins nothing while every query still returns rows: `matched: 0` with non-zero counts on both sides is that failure, not a backlog. REST aggregates publicly-visible posts only, so its figures can differ from the MCP tool's. operationId: getLinkedinStatsGet parameters: - { name: from, in: query, description: Published on or after this date., schema: { type: string, format: date }, } - { name: to, in: query, description: Published on or before this date., schema: { type: string, format: date }, } - { name: since, in: query, description: Alias for from., schema: { type: string, format: date }, } responses: "200": description: Totals, per-weekday medians, and ingest health. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: Aggregate LinkedIn performance (JSON body) operationId: getLinkedinStatsPost requestBody: required: false content: application/json: schema: type: object properties: from: { type: string, format: date } to: { type: string, format: date } since: { type: string, format: date } responses: "200": description: Totals, per-weekday medians, and ingest health. content: application/json: schema: { type: object } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/thread-leaderboard: get: tags: [REST API] summary: His own toots ranked by the conversation they started description: "`replies_count` counts DIRECT children only, so it cannot tell a toot that started an argument from one that collected thirteen flat replies. This ranks on the walked thread tree instead: total nodes, how many of them somebody else wrote, how deep it went, and how many distinct people took part. Every `external_*` figure excludes his own replies — the root counts as node 0 and is his — so a thread he is only talking to himself in scores zero and is not listed at all. `text` is the ROOT toot's own text; no reply text is returned, because none is stored. `walk` reports the walker's own state, so an empty leaderboard because nothing has been walked yet is distinguishable from one because nothing drew a reply. REST serves publicly-visible roots only." operationId: getThreadLeaderboard parameters: - { name: sort, in: query, description: "Rank by external reply count, by maximum depth, or by distinct external participants.", schema: { type: string, enum: [external_nodes, depth, participants], default: external_nodes, }, } - { name: limit, in: query, description: Maximum threads returned., schema: { type: integer, minimum: 1, maximum: 200, default: 20 }, } - { name: days, in: query, description: Only threads whose ROOT was published within this many days. Omit for the whole archive., schema: { type: integer, minimum: 1, maximum: 3650 }, } - { name: actor_handle, in: query, description: Narrow to one tracked account (@user@domain or an actor URL)., schema: { type: string }, } responses: "200": description: The ranked threads and the walker's state. content: application/json: schema: { $ref: "#/components/schemas/ThreadLeaderboardResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: His own toots ranked by the conversation they started (JSON body) operationId: getThreadLeaderboardPost requestBody: required: false content: application/json: schema: type: object properties: sort: { type: string, enum: [external_nodes, depth, participants], default: external_nodes, } limit: { type: integer, minimum: 1, maximum: 200, default: 20 } days: { type: integer, minimum: 1, maximum: 3650 } actor_handle: { type: string } responses: "200": description: The ranked threads and the walker's state. content: application/json: schema: { $ref: "#/components/schemas/ThreadLeaderboardResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } /api/v1/thread-tree: get: tags: [REST API] summary: One thread's stored shape, as nodes and edges description: "The walked tree for one root toot, shaped for a visualisation to render directly. Each node carries its id, origin-local id, origin host, permalink, `@user@host` handle, depth and whether it is his; the root is node 0 of its own tree. `edges` is the parent→child list, `participants` the distinct external handles. There is NO REPLY TEXT anywhere in the response — only the root's own text — because the store holds the shape of the conversation and never its words, enforced by CHECK constraints on every column. A renderer opens each node live at its own instance. Note that this endpoint does serve the handles of the external people who replied. Answers only for threads the walker has already stored; REST serves publicly-visible roots only." operationId: getThreadTree parameters: - { name: status, in: query, required: true, description: "The ROOT toot — its AP id, its permalink, or a bare numeric id resolved against OWNER_INSTANCE.", schema: { type: string }, } responses: "200": description: The thread's nodes and edges. content: application/json: schema: { $ref: "#/components/schemas/ThreadTreeResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } post: tags: [REST API] summary: One thread's stored shape (JSON body) operationId: getThreadTreePost requestBody: required: true content: application/json: schema: type: object properties: status: { type: string } required: [status] responses: "200": description: The thread's nodes and edges. content: application/json: schema: { $ref: "#/components/schemas/ThreadTreeResponse" } "400": { $ref: "#/components/responses/BadRequest" } "401": { $ref: "#/components/responses/Unauthorized" } "503": { $ref: "#/components/responses/Disabled" } # ------------------------------------------------------------- Discovery /.well-known/webfinger: get: tags: [Discovery] summary: WebFinger lookup description: | Resolves the bot's account to its actor document. Only the bot's own account resolves. The response also links the human-readable profile page (`profile-page`) and the avatar. Accepts any spelling of the account, case-insensitively: the `acct:` URI, the bare `user@domain` handle, and the actor's URLs (`/actor`, `/@{username}`, `/users/{username}`). `subject` is always returned in the canonical `acct:` form, whichever was asked for. operationId: webfinger security: [] parameters: - name: resource in: query required: true description: "Account URI or handle, e.g. `acct:bot@bot.skvip.lol`." schema: { type: string } - name: rel in: query required: false description: | Narrows the response to the given link relations. May be repeated. An unmatched value returns the subject with an empty `links` array. schema: { type: string } responses: "200": description: JRD document. content: application/jrd+json: schema: { $ref: "#/components/schemas/WebfingerJrd" } "400": description: Missing `resource` parameter. content: application/json: schema: { $ref: "#/components/schemas/Error" } "404": description: Unknown resource. content: application/json: schema: { $ref: "#/components/schemas/Error" } /.well-known/host-meta: get: tags: [Discovery] summary: Host-meta (XRD) description: | The pre-WebFinger discovery hop, carrying the LRDD template that points at `/.well-known/webfinger`. Friendica, GNU Social and several WebFinger clients fetch this first and give up on the account when it 404s. operationId: hostMeta security: [] responses: "200": description: XRD document. content: application/xrd+xml: schema: { type: string } /.well-known/host-meta.json: get: tags: [Discovery] summary: Host-meta (JRD) description: The same LRDD template as `/.well-known/host-meta`, as JSON. operationId: hostMetaJson security: [] responses: "200": description: JRD document. content: application/jrd+json: schema: { $ref: "#/components/schemas/HostMetaJrd" } /.well-known/nodeinfo: get: tags: [Discovery] summary: NodeInfo discovery description: | Points to the NodeInfo 2.0 and 2.1 documents. This is where the fediverse crawlers and instance-info lookups probe; the same document is also served at the bare `/nodeinfo` path. operationId: nodeinfoWellKnown security: [] responses: "200": description: NodeInfo link document. content: application/json: schema: { $ref: "#/components/schemas/NodeInfoLinks" } /nodeinfo: get: tags: [Discovery] summary: NodeInfo discovery (alias) description: Identical to `/.well-known/nodeinfo`. operationId: nodeinfoIndex security: [] responses: "200": description: NodeInfo link document. content: application/json: schema: { $ref: "#/components/schemas/NodeInfoLinks" } /nodeinfo/2.0: get: tags: [Discovery] summary: NodeInfo 2.0 document operationId: nodeinfo20 security: [] responses: "200": description: NodeInfo 2.0 document. content: application/json: schema: { $ref: "#/components/schemas/NodeInfo20" } /nodeinfo/2.1: get: tags: [Discovery] summary: NodeInfo 2.1 document description: NodeInfo 2.0 plus `software.repository`, which the 2.0 schema forbids. operationId: nodeinfo21 security: [] responses: "200": description: NodeInfo 2.1 document. content: application/json: schema: { $ref: "#/components/schemas/NodeInfo21" } # ------------------------------------------------------------ ActivityPub /actor: get: tags: [ActivityPub] summary: Actor document description: | The bot's ActivityPub actor document — typed `Service`, with the bio, profile metadata fields, avatar and header. Also available at `/users/{username}` (Mastodon-compatible alias), which always returns JSON. Content-negotiated: a request whose `Accept` header includes `text/html` gets the human-readable profile page instead. Anything else — including a vague `*/*` or no `Accept` at all — gets the actor document, so federation is unaffected. operationId: getActor security: [] parameters: - name: Accept in: header required: false description: Include `text/html` to receive the profile page rather than JSON. schema: { type: string } responses: "200": description: Actor document, or the profile page for HTML clients. content: application/activity+json: schema: { $ref: "#/components/schemas/Actor" } text/html: schema: { type: string } "/@{username}": get: tags: [ActivityPub] summary: Human-readable profile page description: | The page a person lands on when they look the bot up: who operates it, what it archives, what it does not store about anyone else, and links to verify each claim. This is the URL the actor document advertises as `url`, and the `profile-page` link in the WebFinger response. HTML by default, being the human-facing URL. A caller that explicitly asks for ActivityPub and not HTML gets the actor document instead: Mastodon's URL search fetches this with `Accept: application/activity+json` and reports no results if it cannot reach the actor from here. The page also carries a `` for clients that only parse the HTML. operationId: getProfilePage security: [] parameters: - name: username in: path required: true description: The configured `APP_USERNAME`. schema: { type: string } - name: Accept in: header required: false description: Ask for `application/activity+json` (without `text/html`) to get the actor document. schema: { type: string } responses: "200": description: Profile page, or the actor document for ActivityPub resolvers. content: text/html: schema: { type: string } application/activity+json: schema: { $ref: "#/components/schemas/Actor" } /assets/{image}.png: get: tags: [ActivityPub] summary: Profile avatar or header image description: | The PNGs referenced by the actor document's `icon` and `image`. Immutable and cached for a year; the actor document appends a `v` query carrying a hash of the file contents, so regenerated artwork gets a fresh URL and remote instances re-download it. operationId: getProfileAsset security: [] parameters: - name: image in: path required: true schema: { type: string, enum: [avatar, header] } - name: v in: query required: false description: Content hash. Ignored by the server; present to bust remote caches. schema: { type: string } - name: If-None-Match in: header required: false schema: { type: string } responses: "200": description: PNG image. content: image/png: schema: { type: string, format: binary } "304": description: Not modified — the supplied `If-None-Match` matched the current hash. /actor/inbox: post: tags: [ActivityPub] summary: Actor inbox description: | Receives federated ActivityPub activities. The request must carry a valid HTTP Signature; the signature is verified against the sending actor's key. Also reachable at `/users/{username}/inbox` and the shared inbox `/inbox`. Activities are stored and acknowledged immediately, then processed asynchronously. operationId: postInbox security: [] requestBody: required: true content: application/activity+json: schema: { $ref: "#/components/schemas/Activity" } responses: "202": description: Activity accepted for processing. content: application/json: schema: type: object properties: status: { type: string, example: accepted } "400": description: Invalid JSON or missing activity id. content: application/json: schema: { $ref: "#/components/schemas/Error" } "401": description: HTTP Signature verification failed. content: application/json: schema: { $ref: "#/components/schemas/Error" } /inbox: post: tags: [ActivityPub] summary: Shared inbox description: Server-wide shared inbox. Identical handling to `/actor/inbox`. operationId: postSharedInbox security: [] requestBody: required: true content: application/activity+json: schema: { $ref: "#/components/schemas/Activity" } responses: "202": description: Activity accepted for processing. content: application/json: schema: type: object properties: status: { type: string, example: accepted } "400": description: Invalid JSON or missing activity id. content: application/json: schema: { $ref: "#/components/schemas/Error" } "401": description: HTTP Signature verification failed. content: application/json: schema: { $ref: "#/components/schemas/Error" } /actor/outbox: get: tags: [ActivityPub] summary: Actor outbox description: | The notes the bot wrote itself, wrapped in public `Create` activities — the only content it ever publishes. The archive of the followed accounts' posts is private and never appears here. Without `page` this is the `OrderedCollection` itself, carrying `totalItems`, `first` and `last`. With `page` it is an `OrderedCollectionPage` (20 per page, newest-first) carrying `partOf` and, where applicable, `next` and `prev`. Also served under the Mastodon-style `/users/{username}/outbox` alias, which answers with the same canonical ids. operationId: getOutbox security: [] parameters: - name: page in: query description: One-indexed page number. Omit to get the collection itself. schema: { type: integer, minimum: 1 } responses: "200": description: Ordered collection, or one page of it. content: application/activity+json: schema: oneOf: - $ref: "#/components/schemas/OrderedCollection" - $ref: "#/components/schemas/OrderedCollectionPage" /actor/featured: get: tags: [ActivityPub] summary: Featured (pinned) collection description: | The bot's pinned notes, embedded rather than listed as bare URIs. Mastodon fetches this whenever it discovers or refreshes the account and renders what it finds at the top of the profile — the one route by which a note of ours reaches someone else, given the bot has no followers to deliver to. Also served under `/users/{username}/featured`. operationId: getFeatured security: [] responses: "200": description: Ordered collection of `Note` objects. content: application/activity+json: schema: { $ref: "#/components/schemas/OrderedCollection" } /notes/{id}: get: tags: [ActivityPub] summary: A single note description: | One of the bot's own notes. This URL is both the note's ActivityPub `id` and its web address, so it defaults to the ActivityPub object: a server dereferencing the id may send nothing more specific than `Accept: */*`, and HTML would fail ingestion. A request whose `Accept` includes `text/html` gets a readable page. operationId: getNote security: [] parameters: - name: id in: path required: true schema: { type: string, format: uuid } responses: "200": description: The note, as ActivityPub JSON or as HTML. content: application/activity+json: schema: { type: object } text/html: schema: { type: string } "404": description: No such note. /actor/followers: get: tags: [ActivityPub] summary: Followers collection description: Always empty — the bot does not accept followers. operationId: getFollowers security: [] responses: "200": description: Empty ordered collection. content: application/activity+json: schema: { $ref: "#/components/schemas/OrderedCollection" } /actor/following: get: tags: [ActivityPub] summary: Following collection description: Public list of actors the bot follows (accepted follows only). operationId: getFollowing security: [] responses: "200": description: Ordered collection of actor IDs. content: application/activity+json: schema: { $ref: "#/components/schemas/OrderedCollection" } # ------------------------------------------------------------------ Health /health: get: tags: [Health] summary: Health check operationId: getHealth security: [] responses: "200": description: Service is healthy. content: application/json: schema: type: object properties: status: { type: string, example: ok } timestamp: { type: string, format: date-time } components: securitySchemes: BearerAuth: type: http scheme: bearer description: "Send the REST API key as `Authorization: Bearer `." ApiKeyAuth: type: apiKey in: header name: X-API-Key description: "Alternative to Bearer: send the REST API key as `X-API-Key: `." parameters: ActorHandleRequired: name: actor_handle in: query required: true description: Actor handle (`@user@domain`) or full actor URL. schema: { type: string } SortOrder: name: sort_order in: query description: "`desc` (default) is newest-first; `asc` is oldest-first." schema: { type: string, enum: [asc, desc], default: desc } Cursor: name: cursor in: query description: Opaque pagination cursor from a previous response's `next_cursor`. schema: { type: string } YoutubeShorts: name: shorts in: query description: >- Shorts handling. The flag is **derived by this server**, not supplied by YouTube — the archive carries no Shorts flag at all. Each video is decided by a stored classification where one exists (`is_short_method` says how), and otherwise falls back to the flat `duration < 180s` guess. `only` requires a positive answer; `exclude` drops those but **keeps** anything unknown, because an unknown is unknown, not long-form. Read `shorts_split` on `/youtube-stats` for how much of a result is known versus guessed. schema: { type: string, enum: [include, exclude, only], default: include } YoutubeIncludeUnresolved: name: include_unresolved in: query description: >- Whether to include unresolved watches — deleted or private videos with no title and no channel. Default true: they are real watch events, and dropping them makes totals disagree with the archive. schema: { type: boolean, default: true } responses: BadRequest: description: Request failed schema validation. content: application/json: schema: allOf: - $ref: "#/components/schemas/Error" - type: object properties: issues: type: array items: { type: object } Unauthorized: description: Missing or invalid API key. content: application/json: schema: { $ref: "#/components/schemas/Error" } NotFound: description: The referenced actor handle could not be resolved. content: application/json: schema: { $ref: "#/components/schemas/Error" } Disabled: description: REST API disabled (`REST_API_KEY` not configured). content: application/json: schema: { $ref: "#/components/schemas/Error" } schemas: Error: type: object properties: error: { type: string } required: [error] # ---- REST request bodies ---- ActorPostsRequest: type: object required: [actor_handle] properties: actor_handle: { type: string, description: Actor handle (`@user@domain`) or full actor URL., } limit: { type: integer, minimum: 1, maximum: 100, default: 20 } since: { type: string, format: date-time } until: { type: string, format: date-time } object_types: { type: array, items: { type: string } } tag: type: string description: | Only posts carrying this hashtag (case-insensitive, leading `#` optional), e.g. `togselfie`. Filtered in SQL so `limit` counts matching posts. sort_order: { type: string, enum: [asc, desc], default: desc } cursor: { type: string } # ---- REST response payloads ---- Post: type: object properties: ap_id: { type: string } type: { type: string, example: Note } content: { type: [string, "null"] } summary: { type: [string, "null"] } url: { type: [string, "null"] } in_reply_to: { type: [string, "null"] } published_at: { type: [string, "null"], format: date-time } attachments: { type: [array, "null"], items: { type: object } } tags: { type: [array, "null"], items: { type: object } } ActorPostsResponse: type: object properties: count: { type: integer } next_cursor: { type: [string, "null"] } sort_order: { type: string, enum: [asc, desc] } filters: type: object properties: actor_handle: { type: string } since: { type: [string, "null"] } until: { type: [string, "null"] } object_types: { type: [array, "null"], items: { type: string } } tag: { type: [string, "null"] } posts: type: array items: { $ref: "#/components/schemas/Post" } ReadingStatus: type: object properties: title: { type: [string, "null"] } authors: { type: [string, "null"] } cover: { type: [string, "null"] } shelf: { type: [string, "null"], enum: [reading, read, to-read, stopped-reading, null], } started_date: { type: [string, "null"], description: Derived from the first public "reading" status (day granularity)., } finished_date: { type: [string, "null"], description: Derived from the "read" status or review that finished the book (day granularity)., } started_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null], description: Where started_date came from (ADR 0063)., } finished_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null] } rating: { type: [string, "null"] } bookwyrm_book_url: { type: [string, "null"] } pages: { type: [integer, "null"] } language: { type: [string, "null"] } shelved_date: { type: [string, "null"], description: When the book was added to its shelf (live mode only; from the shelf item)., } BookSummary: type: object properties: book_url: { type: string } work_url: { type: [string, "null"] } title: { type: [string, "null"] } subtitle: { type: [string, "null"] } author: { type: [string, "null"], description: All authors as one comma-joined display string., } series: { type: [string, "null"] } pages: { type: [integer, "null"] } physical_format: { type: [string, "null"] } isbn13: { type: [string, "null"] } isbn10: { type: [string, "null"] } pub_year: { type: [integer, "null"] } language: { type: [string, "null"] } original_language: { type: [string, "null"] } publisher: { type: [string, "null"] } cover_url: { type: [string, "null"] } subjects: { type: [array, "null"], items: { type: string } } shelf: type: [string, "null"] enum: [read, reading, to-read, stopped-reading, null] description: >- The shelf a tracked BookWyrm actor has this book on. Null when the book has no live shelf membership, or when two tracked actors disagree — read `shelves` to tell those apart. shelves: type: array items: { type: string } description: Every distinct live shelf this book sits on, across all tracked actors. fetched_at: { type: [string, "null"], format: date-time } BooksResponse: type: object properties: count: { type: integer } total: type: integer description: Total books matching the filters across all pages. page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_order: { type: string, enum: [asc, desc] } filters: type: object properties: title: { type: [string, "null"] } author: { type: [string, "null"] } format: { type: [string, "null"] } language: { type: [string, "null"] } series: { type: [string, "null"] } subject: { type: [string, "null"] } shelf: { type: [string, "null"] } books: type: array items: { $ref: "#/components/schemas/BookSummary" } WatchedTitle: type: object properties: item_url: { type: string } work_key: type: string description: > The work this row stands for (ADR 0075): `tmdb:…`, `imdb:…`, or `url:` when nothing matched. A title marked on several NeoDB instances is one row. item_urls: type: array items: { type: string } description: > Every NeoDB instance URL the work was marked on, oldest enrichment first. Marks, dates, comments and status are merged across all of them; either URL resolves to this row in catalogue-details. category: { type: [string, "null"] } item_type: { type: [string, "null"] } title: { type: [string, "null"] } display_title: { type: [string, "null"] } orig_title: { type: [string, "null"] } mark_titles: type: array items: { type: string } description: > The name(s) the mark(s) federated with, retained through NeoDB's localized-title overwrite (e.g. "Conflict" alongside the stored "Konflikt"). Searched alongside `title`; [] when none. mark_comments: type: array items: { type: string } description: > The note(s) the mark(s) carried, verbatim — newest mark first, duplicates collapsed, deleted marks excluded. Free text in the marker's own words (e.g. "Sett på kino."), never parsed, normalised or translated. An item marked more than once (re-marked, or marked by several actors) carries one entry per distinct comment; [] when none. Filter with `mark_comment`. watched_at: type: [string, "null"] format: date-time description: > The shelf date — when the item was actually watched, read, played or listened to, taken from the mark's `relatedWith` Status. NOT the post timestamp: a 2016 film backfilled today carries watched_at 2016 while its post's published_at is today. For an item marked more than once this is the newest of `watched_dates`. null when the mark carried no date — or when it carried the "date unknown" sentinel, which `watched_date_unknown` reports. watched_dates: type: array items: { type: string, format: date-time } description: > Every distinct shelf date across the item's live marks, newest first, deleted marks excluded — plural like `mark_titles`/`mark_comments`, because an item can be re-watched or marked by more than one actor. [] when none. watched_date_unknown: type: boolean description: > True when a live mark on the item was dated 2000-01-01 on minreol — the "date unknown" sentinel: seen, date deliberately unknown. The server decodes the sentinel to a null `watched_at`, so this flag is what tells a deliberate unknown apart from a mark that carried no date. Such a title belongs to no watch year and must not be read as unwatched, nor as watched on the day it was marked. status: type: [string, "null"] enum: [wishlist, progress, complete, dropped, null] description: > The shelf state the item's NEWEST live mark carries. null when no live mark is tracked for the item — which is not the same as "not finished": items enriched before the mark store existed are grandfathered in and carry no status at all. status_raw: type: [string, "null"] description: The same mark's verb exactly as NeoDB sent it, so an unmapped one is never lost. statuses: type: array items: { type: string } description: > Every live mark's status, newest first — plural like `watched_dates`, because a re-mark is exactly how "progress" becomes "complete". [] when none. year: { type: [integer, "null"] } season_number: { type: [integer, "null"] } episode_count: { type: [integer, "null"] } imdb: { type: [string, "null"] } imdb_url: { type: [string, "null"] } tmdb_url: { type: [string, "null"] } cover_url: { type: [string, "null"] } description: { type: [string, "null"] } genre: { type: [array, "null"], items: { type: string } } director: { type: [array, "null"], items: { type: string } } actors: { type: [array, "null"], items: { type: string } } language: { type: [array, "null"], items: { type: string } } area: { type: [array, "null"], items: { type: string } } rating: { type: [number, "null"] } external_resources: { type: [array, "null"], items: { type: object } } details: type: object description: > Category-specific fields ({} for film/TV & unknown categories). book: author, isbn, pages, publisher; music: artist, release_date, track_count, barcode; game: developer, publisher, platform, release_date; podcast: host, feed_url; performance: playwright, director, troupe, venue, opening_date. additionalProperties: true bookwyrm_book_url: type: [string, "null"] description: For a NeoDB book deduped to a cached BookWyrm Edition by ISBN, that Edition's book_url; null otherwise. fetched_at: { type: [string, "null"], format: date-time } WatchedResponse: type: object properties: count: { type: integer } total: type: integer description: Total titles matching the filters across all pages. page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_by: { type: string, enum: [fetched_at, watched_at] } sort_order: { type: string, enum: [asc, desc] } filters: type: object properties: title: { type: [string, "null"] } category: { type: [string, "null"] } item_type: { type: [string, "null"] } genre: { type: [string, "null"] } imdb: { type: [string, "null"] } mark_comment: { type: [string, "null"] } status: { type: [string, "null"] } exclude_status: { type: [array, "null"], items: { type: string } } watched_from: { type: [string, "null"] } watched_to: { type: [string, "null"] } watched_year: { type: [integer, "null"] } watched_date_unknown: { type: [boolean, "null"] } watched_window: type: [object, "null"] description: > The window `watched_from`/`watched_to`/`watched_year` actually resolved to, so a caller can see that a bare `watched_to` date was taken as the whole day. null when no date filter was given. properties: from: { type: [string, "null"], format: date-time } to: { type: [string, "null"], format: date-time } to_exclusive: type: boolean description: true when `to` is the following midnight (a bare YYYY-MM-DD bound), false when it is the caller's own inclusive instant. include_unenriched: { type: boolean } include_hidden: { type: boolean } titles: type: array items: { $ref: "#/components/schemas/WatchedTitle" } Gig: type: object description: One gig from the concert log. properties: concert_url: { type: string } title: { type: [string, "null"], description: 'The composite title the origin renders: "Artist, Venue, City, DATE".', } gig_date: type: [string, "null"] format: date description: The night of the gig. The date to use for anything historical. start_at: type: [string, "null"] format: date-time description: > The instant the music started, when the origin knows the venue's timezone and the concert's start time. Absent for most of a backfilled archive, which is why `gig_date` exists separately and is what sorts. doors_time: { type: [string, "null"], description: Local wall clock in the venue's zone., } concert_status: type: [string, "null"] enum: [scheduled, cancelled, postponed, completed, null] tour_name: { type: [string, "null"] } festival_name: { type: [string, "null"] } notes: { type: [string, "null"] } venue: type: object properties: url: { type: [string, "null"] } name: { type: [string, "null"] } city: { type: [string, "null"] } country: { type: [string, "null"] } lineup: type: array description: role is headliner | opener | guest, or null when the origin served no roles. items: type: object properties: artistUrl: { type: [string, "null"] } name: { type: [string, "null"] } role: { type: [string, "null"] } position: { type: [integer, "null"] } artist_names: { type: array, items: { type: string } } rsvp_status: type: [string, "null"] enum: [interested, going, attended, null] description: The newest live attendance's RSVP state. null when nothing on the wire said. status_source: type: [string, "null"] enum: [tag, property, template, null] description: > Where `rsvp_status` came from. `tag`/`property` means the origin published it as data; `template` means it was read off the generated opening sentence and should be treated as derived. reviews: type: array description: The write-up(s), verbatim, newest first, duplicates collapsed. [] when none. items: { type: string } photos: type: array items: type: object properties: url: { type: string } altText: { type: [string, "null"] } mediaType: { type: [string, "null"] } width: { type: [integer, "null"] } height: { type: [integer, "null"] } song_count: type: [integer, "null"] description: null means nobody recorded a setlist, which is not the same as a gig with no songs. logged_at: type: [string, "null"] format: date-time description: When the attendance was posted. The paperwork, not the night. fetched_at: { type: [string, "null"], format: date-time } fetch_error: { type: [string, "null"], description: Only present with include_unenriched=true., } fetch_attempts: { type: [integer, "null"], description: Only present with include_unenriched=true., } GigsResponse: type: object properties: count: { type: integer } total: type: integer description: Total gigs matching the filters across all pages. page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_by: { type: string, enum: [gig_date, logged_at] } sort_order: { type: string, enum: [asc, desc] } filters: type: object additionalProperties: true gigs: type: array items: { $ref: "#/components/schemas/Gig" } GigDetails: type: object description: One gig's full record, incl. its setlist, its venue and per-field provenance. properties: error: { type: string, description: Present instead of the record when nothing matched., } concert_url: { type: string } title: { type: [string, "null"] } gig_date: { type: [string, "null"], format: date } start_at: { type: [string, "null"], format: date-time } doors_time: { type: [string, "null"] } concert_status: { type: [string, "null"] } tour_name: { type: [string, "null"] } festival_name: { type: [string, "null"] } notes: { type: [string, "null"] } venue: type: object description: The venue's own catalogue record when it has been fetched; otherwise the denormalised subset carried on the gig. additionalProperties: true lineup: { type: array, items: { type: object, additionalProperties: true } } artist_names: { type: array, items: { type: string } } setlists: type: array description: One entry per artist with a recorded setlist. [] when the origin serves none. items: type: object properties: id: { type: [string, "null"] } artistUrl: { type: [string, "null"] } entries: type: array items: type: object properties: position: { type: [integer, "null"] } setNumber: { type: [integer, "null"] } isEncore: { type: boolean } songTitle: { type: string } isCover: { type: boolean } coverOfArtist: { type: [string, "null"] } note: { type: [string, "null"] } song_count: { type: [integer, "null"] } rsvp_status: { type: [string, "null"] } status_source: { type: [string, "null"] } reviews: { type: array, items: { type: string } } photos: { type: array, items: { type: object, additionalProperties: true } } logged_at: { type: [string, "null"], format: date-time } details: { type: object, additionalProperties: true } source_map: type: object description: "Per-field provenance: samklang-ap or samklang-jsonld." additionalProperties: { type: string } enrichment: type: object properties: fetched_at: { type: [string, "null"], format: date-time } enriched_at: { type: [string, "null"], format: date-time } fetch_error: { type: [string, "null"] } fetch_attempts: { type: integer } hidden: { type: boolean } TheatreVisit: type: object description: One mark on a play or production, joined to its enriched catalogue record. properties: mark_id: { type: string, format: uuid } item_url: { type: string } item_type: { type: [string, "null"], enum: [Performance, PerformanceProduction] } title: { type: [string, "null"] } orig_title: { type: [string, "null"] } seen_at: { type: [string, "null"], format: date-time, description: The night. } seen_date_unknown: { type: boolean } status: { type: [string, "null"] } comment: { type: [string, "null"] } troupe: { type: array, items: { type: string } } venue: { type: array, items: { type: string } } playwright: { type: array, items: { type: string } } orig_creator: { type: array, items: { type: string } } director: { type: array, items: { type: string } } actor: { type: array, items: { type: string } } cast: type: array items: type: object properties: name: { type: string } role: { type: string } composer: { type: array, items: { type: string } } choreographer: { type: array, items: { type: string } } performer: { type: array, items: { type: string } } opening_date: { type: [string, "null"] } closing_date: { type: [string, "null"] } official_site: { type: [string, "null"] } play_url: { type: [string, "null"] } year: { type: [integer, "null"] } language: { type: array, items: { type: string } } description: { type: [string, "null"] } cover_url: { type: [string, "null"] } mark_url: { type: [string, "null"] } marked_by: { type: string } marked_at: { type: [string, "null"], format: date-time } enriched: { type: boolean } TheatreResponse: type: object properties: count: { type: integer } total: { type: integer } page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_by: { type: string } sort_order: { type: string } filters: { type: object, additionalProperties: true } visits: type: array items: { $ref: "#/components/schemas/TheatreVisit" } TheatreDetails: allOf: - $ref: "#/components/schemas/TheatreVisit" - type: object properties: visits: type: array items: { $ref: "#/components/schemas/TheatreVisit" } visit_count: { type: integer } play: type: [object, "null"] properties: item_url: { type: string } title: { type: [string, "null"] } productions: type: array items: type: object properties: item_url: { type: string } title: { type: [string, "null"] } troupe: { type: array, items: { type: string } } external_resources: {} source_map: { type: object, additionalProperties: true } enrichment: { type: [object, "null"], additionalProperties: true } error: { type: string } TheatreNameCount: type: object properties: name: { type: string } visits: { type: integer } TheatreStats: type: object properties: filters: { type: object, additionalProperties: true } totals: type: object properties: visits: { type: integer } plays: { type: integer } productions: { type: integer } with_comment: { type: integer } date_unknown: { type: integer } undated: { type: integer } first_seen: { type: [string, "null"], format: date-time } last_seen: { type: [string, "null"], format: date-time } by_year: type: array items: type: object properties: year: { type: string } visits: { type: integer } by_status: type: array items: type: object properties: status: { type: [string, "null"] } visits: { type: integer } top_troupes: { type: array, items: { $ref: "#/components/schemas/TheatreNameCount" }, } top_venues: { type: array, items: { $ref: "#/components/schemas/TheatreNameCount" }, } top_playwrights: { type: array, items: { $ref: "#/components/schemas/TheatreNameCount" }, } top_original_creators: { type: array, items: { $ref: "#/components/schemas/TheatreNameCount" }, } top_directors: { type: array, items: { $ref: "#/components/schemas/TheatreNameCount" }, } top_actors: { type: array, items: { $ref: "#/components/schemas/TheatreNameCount" }, } GigStats: type: object properties: filters: type: object additionalProperties: true totals: type: object properties: gigs: { type: integer } artists: type: integer description: Distinct artist NAMES across every line-up in range, so two artists sharing a name count once. venues: { type: integer } cities: { type: integer } countries: { type: integer } songs_played: type: integer description: Songs on record. Only ever as complete as the setlists are. gigs_with_setlist: { type: integer } gigs_with_review: { type: integer } first_gig: { type: [string, "null"], format: date } last_gig: { type: [string, "null"], format: date } by_status: type: array items: type: object properties: status: { type: [string, "null"] } gigs: { type: integer } by_year: type: array items: type: object properties: year: { type: string } gigs: { type: integer } top_artists: type: array items: type: object properties: name: { type: string } gigs: { type: integer } top_venues: type: array items: type: object properties: name: { type: string } city: { type: [string, "null"] } gigs: { type: integer } top_cities: type: array items: type: object properties: city: { type: string } gigs: { type: integer } top_songs: type: array description: Songs heard most often across recorded setlists — never a complete picture of what was played. items: type: object properties: song: { type: string } plays: { type: integer } CatalogueDetails: type: object description: One NeoDB catalogue item's full cached record, incl. per-field provenance. properties: tmdb_refined_at: type: [string, "null"] format: date-time description: > When English metadata was last laid over NeoDB's from TMDB (ADR 0076). Fields it set say `tmdb` in source_map. Null when not refined on the last pass. tmdb_error: type: [string, "null"] description: Why the last TMDB call failed; retried by the periodic sync. tmdb_attempts: { type: integer } item_url: { type: string } work_key: type: string description: > The work this row stands for (ADR 0075): `tmdb:…`, `imdb:…`, or `url:` when nothing matched. A title marked on several NeoDB instances is one row. item_urls: type: array items: { type: string } description: > Every NeoDB instance URL the work was marked on, oldest enrichment first. Marks, dates, comments and status are merged across all of them; either URL resolves to this row in catalogue-details. category: { type: [string, "null"] } item_type: { type: [string, "null"] } title: { type: [string, "null"] } display_title: { type: [string, "null"] } orig_title: { type: [string, "null"] } mark_titles: type: array items: { type: string } description: > The name(s) the mark(s) federated with, retained through NeoDB's localized-title overwrite (e.g. "Conflict" alongside the stored "Konflikt"). Searched alongside `title`; origin recorded as 'activitypub' in source_map. [] when none. mark_comments: type: array items: { type: string } description: > The note(s) the mark(s) carried, verbatim — newest mark first, duplicates collapsed, deleted marks excluded. Free text in the marker's own words (e.g. "Sett på kino."), never parsed, normalised or translated. An item marked more than once (re-marked, or marked by several actors) carries one entry per distinct comment; [] when none. watched_at: type: [string, "null"] format: date-time description: > The shelf date — when the item was actually watched, read, played or listened to, taken from the mark's `relatedWith` Status. NOT the post timestamp: a 2016 film backfilled today carries watched_at 2016 while its post's published_at is today. For an item marked more than once this is the newest of `watched_dates`. null when the mark carried no date — or when it carried the "date unknown" sentinel, which `watched_date_unknown` reports. watched_dates: type: array items: { type: string, format: date-time } description: > Every distinct shelf date across the item's live marks, newest first, deleted marks excluded — plural like `mark_titles`/`mark_comments`, because an item can be re-watched or marked by more than one actor. [] when none. watched_date_unknown: type: boolean description: > True when a live mark on the item was dated 2000-01-01 on minreol — the "date unknown" sentinel: seen, date deliberately unknown. The server decodes the sentinel to a null `watched_at`, so this flag is what tells a deliberate unknown apart from a mark that carried no date. Such a title belongs to no watch year and must not be read as unwatched, nor as watched on the day it was marked. status: type: [string, "null"] enum: [wishlist, progress, complete, dropped, null] description: > The shelf state the item's NEWEST live mark carries. null when no live mark is tracked for the item — which is not the same as "not finished": items enriched before the mark store existed are grandfathered in and carry no status at all. status_raw: type: [string, "null"] description: The same mark's verb exactly as NeoDB sent it, so an unmapped one is never lost. statuses: type: array items: { type: string } description: > Every live mark's status, newest first — plural like `watched_dates`, because a re-mark is exactly how "progress" becomes "complete". [] when none. year: { type: [integer, "null"] } season_number: { type: [integer, "null"] } episode_count: { type: [integer, "null"] } imdb: { type: [string, "null"] } imdb_url: { type: [string, "null"] } tmdb_url: { type: [string, "null"] } director: { type: [array, "null"], items: { type: string } } actors: { type: [array, "null"], items: { type: string } } cover_url: { type: [string, "null"] } description: { type: [string, "null"] } genre: { type: [array, "null"], items: { type: string } } language: { type: [array, "null"], items: { type: string } } area: { type: [array, "null"], items: { type: string } } rating: { type: [number, "null"] } external_resources: { type: [array, "null"], items: { type: object } } details: { type: object, additionalProperties: true } bookwyrm_book_url: { type: [string, "null"] } source_map: type: [object, "null"] description: "{ field: 'neodb' | 'bookwyrm' | 'activitypub' } provenance for every populated field ('activitypub' marks the mark-supplied mark_titles aliases)." additionalProperties: { type: string } fetched_at: { type: [string, "null"], format: date-time, description: Last successful enrichment; null if never enriched., } fetch_error: { type: [string, "null"], description: Last fetch error; null on success. Retried by the periodic sync., } fetch_attempts: { type: integer } last_attempt_at: { type: [string, "null"], format: date-time } MediaPost: type: object properties: ap_id: { type: string } type: { type: string } content: { type: [string, "null"] } url: { type: [string, "null"] } published_at: { type: [string, "null"], format: date-time } attachments: { type: [array, "null"], items: { type: object } } ActorMediaResponse: type: object properties: count: { type: integer } posts: type: array items: { $ref: "#/components/schemas/MediaPost" } SearchResult: type: object properties: apId: { type: string } type: { type: string } actorApId: { type: string } content: { type: [string, "null"] } summary: { type: [string, "null"] } url: { type: [string, "null"] } publishedAt: { type: [string, "null"], format: date-time } SearchResponse: type: object properties: count: { type: integer } results: type: array items: { $ref: "#/components/schemas/SearchResult" } Follow: type: object properties: actorApId: { type: string } status: { type: string, enum: [pending, accepted, rejected] } followedAt: { type: [string, "null"], format: date-time } acceptedAt: { type: [string, "null"], format: date-time } rejectedAt: { type: [string, "null"], format: date-time } handle: { type: [string, "null"] } displayName: { type: [string, "null"] } iconUrl: { type: [string, "null"] } domain: { type: [string, "null"] } ActivityStatsResponse: type: object properties: total: { type: integer } by_type: type: array items: type: object properties: type: { type: string } count: { type: integer } with_attachments: { type: integer } since: { type: [string, "null"] } HashtagScope: type: object properties: actor: { type: [string, "null"] } tag: { type: [string, "null"] } from: { type: [string, "null"], format: date-time } to: { type: [string, "null"], format: date-time } since: { type: [string, "null"], format: date-time } HashtagStatsResponse: type: object properties: scope: { $ref: "#/components/schemas/HashtagScope" } total_hashtag_uses: { type: integer } distinct_hashtags: { type: integer } posts_total: { type: integer } posts_with_hashtags: { type: integer } posts_with_hashtags_pct: { type: number } avg_hashtags_per_post: { type: number } top_hashtags: type: array items: type: object properties: tag: { type: string } count: { type: integer } first_used: { type: [string, "null"], format: date-time } last_used: { type: [string, "null"], format: date-time } top_cooccurring_pairs: type: array items: type: object properties: tag_a: { type: string } tag_b: { type: string } count: { type: integer } HashtagTrendsResponse: type: object properties: scope: { $ref: "#/components/schemas/HashtagScope" } group_by: { type: string, enum: [week, month, year] } series: type: array description: >- Each point has `period` plus either `uses`/`distinct_hashtags` (overall) or `count` (when a single tag is charted). items: type: object properties: period: { type: string } uses: { type: integer } distinct_hashtags: { type: integer } count: { type: integer } EngagementResultItem: type: object description: >- Success items carry the counts and snapshot state; failure items carry `error` (unresolved_origin | not_found | unauthorized | unsupported_software | rate_limited | fetch_failed) and `message`. properties: input: { type: string, description: The reference as passed in. } status_ap_id: type: string description: Canonical AP object id, as reported by the origin. status_id: { type: string, description: Origin-local status id. } origin: { type: string, description: Origin instance hostname. } url: { type: [string, "null"], description: Human-facing permalink. } favourites_count: { type: integer } reblogs_count: { type: integer } replies_count: { type: integer } quotes_count: { type: [integer, "null"], description: Null when the origin doesn't report quote counts., } source: { type: string, enum: [rest, ap], description: "`ap` collection totals can under-report vs REST.", } sampled_at: { type: string, format: date-time } snapshot_id: { type: [string, "null"] } snapshot: { type: string, enum: [written, skipped_unchanged, disabled] } snapshot_error: { type: string, description: Set when the live read succeeded but the write failed., } error: { type: string } message: { type: string } EngagementResponse: type: object properties: ok: { type: integer, description: Number of successful reads. } failed: { type: integer, description: Number of per-item failures. } results: type: array description: One item per input reference, in input order. items: { $ref: "#/components/schemas/EngagementResultItem" } EngagementTrendsResponse: type: object properties: status_ap_id: { type: string } group_by: { type: string, enum: [hour, day, week, month] } metric: { type: string, enum: [favourites, reblogs, replies, all] } series: type: array description: >- Oldest to newest. With metric=all each point carries every count plus `d_*` deltas vs the previous bucket; with a single metric, `value` and `delta`. First bucket's deltas are null; negative deltas are real (un-favourites, undone boosts). items: type: object properties: bucket: { type: string } sampled_at: { type: string, format: date-time, description: When the bucket's latest snapshot was taken., } favourites: { type: integer } reblogs: { type: integer } replies: { type: integer } quotes: { type: [integer, "null"] } d_favourites: { type: [integer, "null"] } d_reblogs: { type: [integer, "null"] } d_replies: { type: [integer, "null"] } d_quotes: { type: [integer, "null"] } value: { type: integer } delta: { type: [integer, "null"] } first_sampled_at: { type: [string, "null"], format: date-time } last_sampled_at: { type: [string, "null"], format: date-time } snapshot_count: { type: integer } RecentActivity: type: object properties: id: { type: integer } type: { type: string } actorApId: { type: string } objectType: { type: [string, "null"] } receivedAt: { type: [string, "null"], format: date-time } EventType: type: string enum: [ started_reading, finished_reading, stopped_reading, review, rating, comment, quotation, note, shelved, ] ReadingEvent: type: object properties: event_type: { $ref: "#/components/schemas/EventType" } reading_status: { type: [string, "null"], enum: [read, reading, to-read, null], description: BookWyrm shelf state stamped on the post; "read" marks a finish on this date., } book_title: { type: [string, "null"] } book_author: { type: [string, "null"] } started_date: { type: [string, "null"], description: Set when THIS event marks a reading start (a "reading" status)., } finished_date: { type: [string, "null"], description: Set when THIS event marks a finish (a "read" status or a review)., } book_started_date: { type: [string, "null"], description: The book's derived overall start date (first "reading" signal)., } book_finished_date: { type: [string, "null"], description: The book's derived overall finish date (last reading cycle's finish)., } book_started_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null], description: Where book_started_date came from. StoryGraph fills a date BookWyrm lacks and never replaces one (ADR 0063)., } book_finished_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null], description: Where book_finished_date came from., } book_reads: type: array description: One window per read, oldest first, so a reread is two windows rather than one spanning both. items: type: object properties: read: { type: integer, description: 1-based read ordinal. } started_date: { type: [string, "null"], format: date } started_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null] } finished_date: { type: [string, "null"], format: date } finished_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null] } abandoned_date: { type: [string, "null"], format: date } rating: { type: [string, "null"] } review_title: { type: [string, "null"] } comment: { type: [string, "null"] } quote: { type: [string, "null"], description: The quoted passage (quotation events only; HTML stripped)., } progress: { type: [number, "null"] } progress_mode: { type: [string, "null"] } published_at: { type: [string, "null"], format: date-time } ap_id: { type: string } bookwyrm_book_url: { type: [string, "null"] } ReadingEventsResponse: type: object properties: count: { type: integer } next_cursor: { type: [string, "null"] } sort_order: { type: string, enum: [asc, desc] } filters: type: object properties: actor_handle: { type: string } event_type: { type: [string, "null"] } since: { type: [string, "null"] } events: type: array items: { $ref: "#/components/schemas/ReadingEvent" } NowPlayingResponse: type: object properties: nowPlaying: type: [boolean, "null"] description: >- true when a track is playing, false when Last.fm answered and nothing is, null when the upstream read failed (see `error`). error: type: string description: Present only when `nowPlaying` is null. track: { type: string } artist: { type: string } album: { type: [string, "null"] } image: { type: [string, "null"] } url: { type: [string, "null"] } required: [nowPlaying] Scrobble: type: object properties: playedAt: { type: string, format: date-time } track: { type: string } artist: { type: string } album: { type: [string, "null"] } url: { type: [string, "null"] } image: { type: [string, "null"] } loved: { type: boolean } ScrobblesResponse: type: object properties: count: { type: integer } page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_order: { type: string, enum: [asc, desc] } filters: type: object properties: artist: { type: [string, "null"] } album: { type: [string, "null"] } track: { type: [string, "null"] } from: { type: [string, "null"] } to: { type: [string, "null"] } scrobbles: type: array items: { $ref: "#/components/schemas/Scrobble" } ScrobbleStatsResponse: type: object properties: total_scrobbles: { type: integer } first_played_at: { type: [string, "null"], format: date-time } last_played_at: { type: [string, "null"], format: date-time } group_by: { type: string, enum: [artist, album, track] } top: type: array items: type: object properties: artist: { type: string } album: { type: string } track: { type: string } plays: { type: integer } image: { type: [string, "null"] } filters: type: object properties: artist: { type: [string, "null"] } album: { type: [string, "null"] } track: { type: [string, "null"] } range: type: object properties: from: { type: [string, "null"] } to: { type: [string, "null"] } ScrobbleTimelineResponse: type: object properties: bucket: { type: string, enum: [day, week, month] } group_by: { type: string, enum: [artist, album, track] } timezone: type: string description: The IANA zone the buckets were cut in. range: type: object description: "The resolved range, clamped to the archive's own first day and to today. Both null when nothing matched." properties: from: { type: [string, "null"], format: date } to: { type: [string, "null"], format: date } totals: type: object properties: buckets: type: integer description: "Every bucket in the range, including the silent ones that `include_empty_buckets=false` leaves out of the array." active_buckets: { type: integer } scrobbles: { type: integer } distinct_artists: type: integer description: "Distinct ARTISTS, whatever `group_by` is: two albums by one artist are one artist here and two entities below." distinct_entities: { type: integer } other_key: type: string description: "The key `top_n` overflow was summed into. Normally `Other`, but it steps aside if a real entity is called that, so read it rather than assuming it." entities: type: object description: 'Range-wide figures per entity, hoisted out of the buckets. Keyed by entity name for `group_by=artist` and " - " otherwise; `artist` and `name` are carried as fields so the key never needs parsing apart.' additionalProperties: type: object properties: plays: { type: integer } image: { type: [string, "null"] } artist: { type: string } name: { type: string } buckets: type: array description: Newest bucket first. items: type: object properties: date: type: string format: date description: "The bucket's first local day: a Monday for `bucket=week`, the 1st for `bucket=month`." plays: type: integer description: "The bucket's TRUE total, unaffected by `top_n` and `min_plays`. `entities` sums to this except where `min_plays` dropped rows." top: type: [string, "null"] description: "The entity with the most plays in this bucket, taken from the raw counts: never `other_key`, and unchanged by `top_n`. Null for a silent bucket." entities: type: object description: Entity key to play count, ordered plays-descending. additionalProperties: { type: integer } filters: type: object properties: artist: { type: [string, "null"] } album: { type: [string, "null"] } track: { type: [string, "null"] } PagesTimelineResponse: type: object properties: bucket: { type: string, enum: [day, week, month] } range: type: object description: "The resolved range, clamped to the first day with pages and to today. Both null when nothing matched." properties: from: { type: [string, "null"], format: date } to: { type: [string, "null"], format: date } totals: type: object properties: buckets: type: integer description: "Every bucket in the range, including the silent ones that `include_empty_buckets=false` leaves out of the array." active_buckets: { type: integer } active_days: type: integer description: Days whose summed pages are above zero. pages: { type: integer } entries: type: integer description: Entries that contributed (live, dated, with `pages_read`). distinct_books: { type: integer } avg_pages_per_active_day: { type: [number, "null"] } other_key: type: string description: "The key `top_n` overflow was summed into. Normally `Other`; read it rather than assuming it." books: type: object description: "Range-wide figures per book, keyed by title. Two different books sharing a title get an id suffix rather than merging; `book_id` is carried so the key never needs parsing." additionalProperties: type: object properties: book_id: { type: string } title: { type: [string, "null"] } authors: { type: array, items: { type: string } } book_pages: { type: [integer, "null"] } pages: { type: integer } entries: { type: integer } buckets: type: array description: Newest bucket first. items: type: object properties: date: type: string format: date description: "The bucket's first day: a Monday for `bucket=week`, the 1st for `bucket=month`." pages: type: integer description: "The bucket's TRUE total, unaffected by `top_n`." entries: { type: integer } active_days: { type: integer } active_books: { type: integer } top: type: [string, "null"] description: "The book with the most pages in this bucket, from the raw sums: never `other_key`, unchanged by `top_n`. Null when nothing was read." books: type: object description: Book key to pages, ordered pages-descending. additionalProperties: { type: integer } filters: type: object properties: book: { type: [string, "null"] } JournalEntry: type: object properties: id: { type: string } book_id: { type: string } book_title: { type: [string, "null"] } date: type: [string, "null"] format: date description: "The local day StoryGraph shows, stored as a date. Null when undated." kind: type: string description: "progress, started, finished or percent." pages_read: type: [integer, "null"] description: "StoryGraph's own per-update delta. Sum it; never difference `pages_total`." pages_total: { type: [integer, "null"] } book_pages: { type: [integer, "null"] } percent: { type: [number, "null"] } updated_at: type: string format: date-time description: sidetal's `updated_at`. deleted_at: { type: [string, "null"], format: date-time } first_seen_at: { type: string, format: date-time } last_seen_at: { type: string, format: date-time } JournalEntriesResponse: type: object properties: count: { type: integer } total: { type: integer } next_cursor: { type: [string, "null"] } entries: type: array items: { $ref: "#/components/schemas/JournalEntry" } filters: type: object properties: from: { type: [string, "null"], format: date } to: { type: [string, "null"], format: date } book: { type: [string, "null"] } kind: { type: [string, "null"] } include_deleted: { type: boolean } YoutubeWatch: type: object description: One watch event. One row per watch, so a rewatch is a second row. properties: watched_at_local: type: string description: The source's own Europe/Oslo wall clock, `YYYY-MM-DDTHH:MM:SS`, at minute resolution. Use this for anything calendar-shaped. watched_at: type: string format: date-time description: The same moment as a UTC instant, for joining against other time series. Derived from watched_at_local, not independently recorded. video_id: { type: string } video_url: { type: string } title: type: [string, "null"] description: Null when the video is unresolved. channel_name: { type: [string, "null"] } channel_id: type: [string, "null"] description: The UC… id. Null when unresolved, and also null when the source gave an @handle URL carrying no id. duration_seconds: type: [integer, "null"] description: The VIDEO'S length — never how much of it was watched, which this data does not record. Null on ~11% of rows. is_short: type: [boolean, "null"] description: Whether this is a Short. **Derived by this server, not supplied by YouTube.** A stored classification where there is one, otherwise the flat `duration < 180s` guess. **Null, not false, when nothing can decide it.** is_short_method: type: [string, "null"] enum: [duration_rule, api_metadata, probe, unclassifiable, null] description: How the flag was decided. `duration_rule` applies the era rules offline; `api_metadata` uses the real upload date; `probe` requests the `/shorts/` URL and is the **only** method that can confirm a Short. `unclassifiable` is terminal — a deleted or private video that nothing will ever decide. **Null means not yet decided**, and `is_short` is then a guess. is_short_source: type: string enum: [classified, heuristic, unclassifiable, unknown_duration] description: The confidence behind `is_short` in one word. `heuristic` is the flat 180-second guess, which over-counts Shorts because they did not exist before September 2020 and were capped at 60s until 15 October 2024. unresolved: type: boolean description: A deleted or private video. Terminal — enrichment must never retry these. account: { type: string } source: type: string description: Provenance of the row, e.g. `myactivity-console`. YoutubeWatchesResponse: type: object properties: count: { type: integer } page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_order: { type: string, enum: [asc, desc] } timezone: { type: string } shorts_threshold_seconds: { type: integer } filters: type: object properties: account: { type: [string, "null"] } channel: { type: [string, "null"] } title: { type: [string, "null"] } video_id: { type: [string, "null"] } from: { type: [string, "null"] } to: { type: [string, "null"] } year: { type: [integer, "null"] } shorts: { type: string, enum: [include, exclude, only] } include_unresolved: { type: boolean } watches: type: array items: { $ref: "#/components/schemas/YoutubeWatch" } YoutubeWatchTimeEstimates: type: object description: >- Three upper bounds, never one number. This data records only that a video was OPENED — no watch duration exists in it — so each figure is wrong in a different direction and quoting one alone misleads. properties: caveat: type: string description: The disclaimer to carry with any figure quoted from here. raw_seconds: { type: integer } raw_hours: type: number description: Sum of full video lengths. Gross overestimate — an eight-hour stream left open for two minutes counts as eight hours. capped_20min_seconds: { type: integer } capped_20min_hours: type: number description: Each row capped at 20 minutes. The least-bad figure for anything resembling "time spent". excluding_shorts_seconds: { type: integer } excluding_shorts_hours: type: number description: Counts only videos of 180s or more. cap_seconds: { type: integer } rows_with_duration: { type: integer } rows_without_duration: type: integer description: These contribute zero to all three estimates, so the true figure is not merely lower — it is unmeasurable. duration_coverage_pct: { type: number } YoutubeStatsResponse: type: object properties: total_watches: { type: integer } distinct_videos: { type: integer } distinct_channels: type: integer description: Counted on the channel **id**. A channel that renamed has one id and two names, so this and distinct_channel_names answer different questions and neither is a typo. distinct_channel_names: { type: integer } first_watched_at_local: { type: [string, "null"] } last_watched_at_local: { type: [string, "null"] } watch_time_estimates: { $ref: "#/components/schemas/YoutubeWatchTimeEstimates" } shorts_split: type: object description: The Shorts split, in watch counts. `shorts`/`long_form`/`unknown` are the resolved totals; the `known_*` and `guessed_*` figures beneath them say how much of that was actually decided versus still falling back to the flat 180-second guess. Unknowns are their own bucket and are never folded into either side. properties: shorts: { type: integer } long_form: { type: integer } unknown: { type: integer } known_short: { type: integer } known_long_form: { type: integer } guessed_short: { type: integer } guessed_long_form: { type: integer } unclassifiable: type: integer description: Deleted and private videos. Terminal, never retried. unknown_duration: type: integer description: No verdict and no duration to guess from. Empty once the classification job has run. by_method: type: object description: The known rows broken down by how they were decided. Only `probe` can confirm a Short; the other two can only rule one out. properties: duration_rule: { type: integer } api_metadata: { type: integer } probe: { type: integer } shorts_threshold_seconds: { type: integer } note: { type: string } unresolved_watches: { type: integer } watches_without_channel: { type: integer } group_by: type: string enum: [channel, year, month, day, weekday, hour_of_day, account, video] group_count: type: integer description: How many buckets exist in total, so truncation by `limit` is visible rather than implied. group_order: { type: string, enum: ["watches desc", "key asc"] } excluded_from_ranking: type: object description: Present only when group_by=channel. Quote it alongside any top-channels answer rather than letting the ranking imply full coverage. properties: watches_without_channel: { type: integer } reason: { type: string } top: type: array items: type: object properties: key: { type: [string, "null"] } label: type: [string, "null"] description: Human-readable name for the group, present for channel and video. For a channel it is the NEWEST name seen, so a renamed channel appears once under what it calls itself now. watches: { type: integer } raw_seconds: { type: integer } rows_with_duration: { type: integer } distinct_videos: type: integer description: Distinct videos behind this bucket's watches. Always 1 for group_by=video; for a channel it is the difference between breadth and rewatching. first_watch: type: [string, "null"] description: Earliest watch in this bucket, as Europe/Oslo local wall clock. With group_by=channel this is when the channel entered the archive, so a lifecycle needs no per-channel round trip. last_watch: type: [string, "null"] description: Latest watch in this bucket, same clock. timezone: { type: string } filters: type: object properties: account: { type: [string, "null"] } channel: { type: [string, "null"] } title: { type: [string, "null"] } video_id: { type: [string, "null"] } from: { type: [string, "null"] } to: { type: [string, "null"] } year: { type: [integer, "null"] } shorts: { type: string, enum: [include, exclude, only] } include_unresolved: { type: boolean } range: type: object properties: from: { type: [string, "null"] } to: { type: [string, "null"] } year: { type: [integer, "null"] } BreakoutRung: type: string enum: [p90, p99, best] description: Which rung of the ladder. p90 = past the p90 of that account's own recent posts, p99 = past its p99, best = a personal best. PostBreakoutsResponse: type: object properties: enabled: type: boolean description: BREAKOUT_ENABLED. False means nothing will ever push. blocked_reason: type: [string, "null"] description: Why the notifier is inert, or null when it is armed. Distinguishes "switched off" from "no ntfy password", which look identical from the phone. topic: { type: string } weights: type: object properties: favourites: { type: number } reblogs: { type: number } replies: { type: number } floor: type: integer description: BREAKOUT_MIN_SCORE — the absolute floor every rung is lifted to, so a quiet fortnight cannot make a two-favourite post exceptional. min_posts: { type: integer } digest_hour: type: integer description: Europe/Oslo hour of the daily digest; -1 when disabled. fast_lane_minutes: { type: integer } actors: type: array items: type: object properties: actor: { type: string } actor_ap_id: { type: string } baseline: type: object description: The raw numbers. Percentiles are over the window; best is all-time. properties: established: type: boolean description: False means nothing fires for this account at all. reason: type: [string, "null"] enum: [no_posts, no_engagement_data, too_few_posts, null] description: > Why the account is not armed, when established is false. Three different problems with three different fixes: no_posts means nothing is being sampled at all (an ingest problem, not a breakout one); no_engagement_data means posts ARE sampled but every one scores zero and always has, because the origin does not report favourite/boost/reply counts back — that account will never fire, whatever the thresholds; too_few_posts is the ordinary case of real engagement without enough history yet. posts_in_window: { type: integer } window_days: { type: integer } median: { type: number } p90: { type: number } p99: { type: number } best: { type: integer } best_status_ap_id: { type: [string, "null"] } second_best: type: integer description: Runner-up, used as the record threshold when the candidate itself holds the record — no post has to beat itself. thresholds: type: object description: What a post must actually reach, after the floor is applied and the rungs are forced strictly apart. These are the numbers the pushes quote. properties: p90: { type: integer } p99: { type: integer } best: { type: integer } tracked_posts: { type: integer } armed: type: array description: Posts clearing a rung further than anything already announced for them. On a working deployment this empties within the hour. items: type: object properties: status_ap_id: { type: string } url: { type: [string, "null"] } published_at: { type: [string, "null"], format: date-time } visibility: { type: [string, "null"] } score: type: integer description: Latest reading; can be below peak_score. peak_score: type: integer description: High-water mark — what the rung is judged against. favourites: { type: integer } reblogs: { type: integer } replies: { type: integer } would_fire: { $ref: "#/components/schemas/BreakoutRung" } spent_rung: oneOf: - { $ref: "#/components/schemas/BreakoutRung" } - { type: "null" } text: { type: [string, "null"] } recent: type: array description: Breakouts actually announced, newest first. A rung pre-marked when the post was first seen was never announced and does not appear here. items: type: object properties: status_ap_id: { type: string } actor: { type: string } url: { type: [string, "null"] } rung: { $ref: "#/components/schemas/BreakoutRung" } fired_at: { type: string, format: date-time } score: type: integer description: The score at which the rung was announced. peak_score: { type: integer } current_score: type: integer description: What it is doing now. Below peak_score means engagement was withdrawn — real, and deliberately not hidden. The rung is not taken back. visibility: { type: [string, "null"] } text: { type: [string, "null"] } ScrobbleRaceResponse: type: object properties: race_id: type: [string, "null"] description: Id of the configured race, or null for an ad-hoc one. title: { type: string } archived: type: boolean description: The race is resolved. Still queryable; the notifier skips it. leader: { $ref: "#/components/schemas/RaceSide" } challenger: { $ref: "#/components/schemas/RaceSide" } gap: type: integer description: Leader's plays minus the challenger's. Negative once passed. leader_ahead: { type: boolean } plays_to_level: { type: integer } plays_to_overtake: { type: integer } pace: type: object properties: window_days: { type: integer } leader_plays_per_day: { type: number } challenger_plays_per_day: { type: number } net_closing_per_day: { type: number } projected_crossover_date: type: [string, "null"] format: date description: Null when the gap is not closing. projected_days: { type: [integer, "null"] } notifications: type: object description: State of the ntfy watcher for this race. properties: armed: { type: boolean } topic: { type: [string, "null"] } last_milestone: { type: [integer, "null"] } next_milestone: { type: [integer, "null"] } endgame_gap: type: integer description: >- The race's endgame countdown band. At or below this gap the milestone ladder stands down and every challenger play that moves the number gets its own alert. 0 disables the countdown; the decisive alerts at gap 1 and gap 0, and the overtake, fire regardless. endgame_armed: type: boolean description: >- Whether the race has ever been observed inside the band. A latch, not a level — it stays true once set, including after the overtake. nowplaying_gap: type: integer description: >- Band for the optional live now-playing watcher (RACE_NOWPLAYING_GAP), which names the currently-playing track as the one about to tie or win. 0 disables it; it requires a scrobbler that sends track.updateNowPlaying. overtaken_at: type: [string, "null"] format: date-time description: >- When the challenger took the lead — the playedAt of the play that did it, not the time the sync noticed. Written once and never overwritten. error: type: string description: Present when no race is configured and none was given. RaceEntity: type: object description: >- What counts as a play for one side of a race. Matched EXACTLY, unlike the substring filters on /scrobbles and /scrobble-stats. `albums` and `tracks` are lists because Last.fm files a single under its own album name, so one campaign is several album rows; listing them folds the side back together. required: [type, artist] properties: type: { type: string, enum: [artist, album, track] } artist: { type: string } albums: type: array items: { type: string } description: Required when type is album. tracks: type: array items: { type: string } description: Required when type is track. RaceSide: type: object properties: artist: { type: string } label: type: string description: How the side is named in the alerts — the artist, record or song. entity: { $ref: "#/components/schemas/RaceEntity" } plays: { type: integer } last_played_at: { type: [string, "null"], format: date-time } last_track: type: [string, "null"] description: >- The last play matching this side — for an album race, the last track played from that record, not the artist's last play. ConvergenceResponse: type: object properties: total_scrobbles: { type: integer } total_km: { type: integer } gap: type: integer description: total_km minus total_scrobbles. Negative while the listening leads. leader: { type: string, enum: [km, scrobbles, tie] } kilometre_resolution: { type: string } counted_legs: { type: string } pace: type: object properties: days: { type: integer } scrobbles_per_day: { type: number } km_per_day: { type: number } net_per_day: { type: number } projected_meeting: description: Null when the gap is not closing at the current rates. type: [object, "null"] properties: days: { type: integer } date: { type: string, format: date } crossings: type: array items: type: object properties: kind: { type: string, enum: [equality, crossover] } occurred_at: type: string format: date-time description: The causing event's own instant — a scrobble's played_at or a leg's departure_at. Never when the watcher noticed. ended_at: { type: [string, "null"], format: date-time } held_seconds: type: [integer, "null"] description: How long an equality held. Null while the window is still open. value: { type: [integer, "null"] } gap: { type: integer } leader: { type: string, enum: [km, scrobbles, tie] } total_scrobbles: { type: integer } total_km: { type: integer } historical: type: boolean description: The crossing predated what the watcher knew; an import rewrote history under it. notified_at: { type: [string, "null"], format: date-time } cause: type: object properties: kind: { type: string, enum: [scrobble, leg] } artist: { type: [string, "null"] } track: { type: [string, "null"] } album: { type: [string, "null"] } url: { type: [string, "null"] } from: { type: [string, "null"] } to: { type: [string, "null"] } journey: { type: [string, "null"] } km: { type: [integer, "null"] } ScrobbleRacesResponse: type: object properties: total: { type: integer } races: type: array items: type: object properties: race_id: { type: string } title: { type: string } archived: { type: boolean } topic: type: string description: The ntfy topic this race's alerts are published to. leader: { $ref: "#/components/schemas/RaceStanding" } challenger: { $ref: "#/components/schemas/RaceStanding" } gap: { type: integer } leader_ahead: { type: boolean } plays_to_overtake: { type: integer } overtaken_at: type: [string, "null"] format: date-time description: When the challenger took the lead, or null. RaceStanding: type: object properties: artist: { type: string } label: { type: string } entity: { $ref: "#/components/schemas/RaceEntity" } plays: { type: integer } Trip: type: object properties: departureAt: { type: [string, "null"], format: date-time } arrivalAt: { type: [string, "null"], format: date-time } from: { type: string } to: { type: string } journey: { type: [string, "null"] } trainCode: { type: [string, "null"] } operator: { type: [string, "null"] } mode: { type: [string, "null"] } travelClass: { type: [string, "null"] } distanceKm: { type: [integer, "null"] } delay: { type: [integer, "null"] } night: { type: boolean } status: { type: [string, "null"] } tags: { type: [array, "null"], items: { type: string } } fromTz: type: [string, "null"] description: >- IANA time zone of the origin station, e.g. Europe/Oslo, derived from the country it geocoded to. Falls back to the zone viaduct.world recorded for the leg, which is offset-correct but not a place (every CET station is exported as Europe/Paris). toTz: type: [string, "null"] description: IANA time zone of the destination station, with the same fallback as fromTz. fromLat: type: [number, "null"] description: Origin station latitude (WGS84); null when not geocoded. fromLon: type: [number, "null"] description: Origin station longitude (WGS84); null when not geocoded. toLat: type: [number, "null"] description: Destination station latitude (WGS84); null when not geocoded. toLon: type: [number, "null"] description: Destination station longitude (WGS84); null when not geocoded. measuredKm: type: [number, "null"] description: | Drawn length of the leg's viaduct.world GPX route, km to one decimal: segments summed, gaps not bridged. Shown beside `distanceKm`, never in place of it; null where no route is stored. See ADR 0071. TrainTripsResponse: type: object properties: count: { type: integer } page: { type: [integer, "null"] } next_cursor: { type: [string, "null"] } sort_order: { type: string, enum: [asc, desc] } filters: { type: object } trips: type: array items: { $ref: "#/components/schemas/Trip" } StationComparison: type: object properties: name: { type: string } latitude: { type: [number, "null"] } longitude: { type: [number, "null"] } display_name: type: [string, "null"] description: What the geocoder matched. country_code: { type: [string, "null"] } source: { type: string, enum: [nominatim, manual] } viaduct_latitude: { type: number } viaduct_longitude: { type: number } distance_km: type: [number, "null"] description: km between the two positions; null when the station is not geocoded. StationDiscrepanciesResponse: type: object properties: min_km: { type: number } coverage: type: object properties: stations: { type: integer } viaduct_waypoints: { type: integer } agreeing: { type: integer } disagreeing: type: array items: { $ref: "#/components/schemas/StationComparison" } not_geocoded: type: array items: { $ref: "#/components/schemas/StationComparison" } no_waypoint: type: array items: { type: string } ViaductWaypointsResponse: type: object properties: count: { type: integer } imported_at: type: [string, "null"] format: date-time description: When the newest of these rows was imported; null when there are none. waypoints: type: array items: type: object properties: name: { type: string } latitude: { type: number } longitude: { type: number } TripTracksResponse: type: object properties: type: { type: string, enum: [FeatureCollection] } count: { type: integer } page: { type: integer } coverage: type: object properties: tracks: { type: integer } matched_to_trips: { type: integer } features: type: array items: type: object properties: type: { type: string, enum: [Feature] } geometry: type: [object, "null"] properties: type: { type: string, enum: [MultiLineString] } coordinates: type: array items: type: array items: type: array items: { type: number } minItems: 2 maxItems: 2 properties: type: object properties: viaduct_trip_id: { type: string } from: { type: string } to: { type: string } departure_local: type: string description: The origin's wall clock, `YYYY-MM-DD HH:MM:SS`, no zone. point_count: { type: integer } segment_count: { type: integer } trip_id: { type: [string, "null"], format: uuid } journey: { type: [string, "null"] } operator: { type: [string, "null"] } train_code: { type: [string, "null"] } mode: { type: [string, "null"] } distance_km: { type: [number, "null"] } measured_km: type: [number, "null"] description: The drawn route's length, km to one decimal. Never a replacement for distance_km. closest_km: type: [number, "null"] description: Only with near_lat/near_lon. How close the route comes to that point, in km. status: { type: [string, "null"] } departure_at: { type: [string, "null"], format: date-time } arrival_at: { type: [string, "null"], format: date-time } TripPostsResponse: type: object properties: count: { type: integer } page: { type: integer } sort_order: { type: string, enum: [asc, desc] } totals: type: object properties: posts: { type: integer } trips: { type: integer } by_relation: type: object properties: boarding: { type: integer } aboard: { type: integer } alighting: { type: integer } filters: { type: object } posts: type: array items: type: object properties: ap_id: { type: string } url: { type: [string, "null"] } content: { type: [string, "null"] } published_at: { type: [string, "null"], format: date-time } attachments: { type: array, items: { type: object } } relation: { type: string, enum: [boarding, aboard, alighting] } offset_seconds: type: [integer, "null"] description: | Signed seconds from the trip's departure; negative while still boarding. trip: type: object properties: from: { type: string } to: { type: string } journey: { type: [string, "null"] } operator: { type: [string, "null"] } train_code: { type: [string, "null"] } mode: { type: [string, "null"] } distance_km: { type: [integer, "null"] } delay: { type: [integer, "null"] } night: { type: [boolean, "null"] } departure_at: { type: string, format: date-time } arrival_at: { type: [string, "null"], format: date-time } TrainStatsResponse: type: object properties: total_trips: { type: integer } total_km: { type: number } total_duration_seconds: { type: number } hours: { type: integer } minutes: { type: integer } distinct_stations: { type: integer } distinct_operators: { type: integer } distinct_journeys: { type: integer } first_trip_at: { type: [string, "null"], format: date-time } last_trip_at: { type: [string, "null"], format: date-time } group_by: { type: string, enum: [journey, operator, mode, year] } top: type: array items: type: object properties: key: { type: [string, "null"] } trips: { type: integer } km: { type: number } upcoming: type: [object, "null"] properties: from: { type: string } to: { type: string } date: { type: string } duration: { type: [string, "null"] } filters: { type: object } LineCoverage: type: object description: | How much of the archive has actually been placed on a line. Stated on every line response so a thin answer reads as "not resolved yet" rather than "he never went there". properties: trips: { type: integer } resolved: { type: integer } ambiguous: type: integer description: Two comparable routings; needs an override to choose between them. unresolved: type: integer description: No route in the curated registry — a ferry, or an uncurated corner of Europe. not_yet_resolved: type: integer description: Imported but the resolver has not reached them yet. stale: type: integer description: Resolved against an older registry; the next resolver run redoes them. unresolved_reasons: type: array items: type: object properties: status: { type: string, enum: [ambiguous, unresolved] } reason: { type: [string, "null"] } trips: { type: integer } RailwayLinesResponse: type: object properties: count: { type: integer } total_entries: { type: integer } registry_version: { type: string } coverage: { $ref: "#/components/schemas/LineCoverage" } filters: { type: object } lines: type: array items: type: object properties: slug: { type: string } name: { type: string } kind: { type: string, enum: [line, crossing] } aliases: { type: array, items: { type: string } } countries: { type: array, items: { type: string } } registry_length_km: { type: [number, "null"] } travelled: { type: boolean } trips: { type: integer } km: { type: number } seconds: { type: integer } first_at: { type: [string, "null"], format: date-time } last_at: { type: [string, "null"], format: date-time } carrier: type: [string, "null"] description: For a crossing, the line whose kilometres its span is measured in. notes: { type: [string, "null"] } LineStatsResponse: type: object properties: line: type: object properties: slug: { type: string } name: { type: string } kind: { type: string, enum: [line, crossing] } matched: type: string description: The spelling that resolved, so a surprising hit is visible. registry_length_km: { type: [number, "null"] } trips: { type: integer } km: { type: number } seconds: { type: integer } hours: { type: integer } minutes: { type: integer } crossings: type: integer description: | Traversals of a named crossing, counted once each in either direction, so an out-and-back day trip counts two. Zero for a plain line. first_at: { type: [string, "null"], format: date-time } last_at: { type: [string, "null"], format: date-time } group_by: { type: string, enum: [year, operator, journey] } by: type: array items: type: object properties: key: { type: [string, "null"] } trips: { type: integer } km: { type: number } seconds: { type: integer } crossings: { type: integer } overrides_applied: type: array description: Every pinned routing behind these numbers, with its stated reason. items: type: object properties: from: { type: string } to: { type: string } method: { type: string, enum: [override_pair, override_trip] } reason: { type: [string, "null"] } trips_by_override: { type: integer } upcoming: type: array description: Trips still to come on this line, kept out of the totals above. items: type: object properties: from: { type: string } to: { type: string } journey: { type: [string, "null"] } date: { type: string } km: { type: number } coverage: { $ref: "#/components/schemas/LineCoverage" } filters: { type: object } LineTripsResponse: type: object properties: line: type: object properties: slug: { type: string } name: { type: string } kind: { type: string, enum: [line, crossing] } matched: { type: string } count: { type: integer } total: { type: integer } page: { type: integer } sort_order: { type: string, enum: [asc, desc] } coverage: { $ref: "#/components/schemas/LineCoverage" } filters: { type: object } trips: type: array items: type: object properties: from: { type: string } to: { type: string } journey: { type: [string, "null"] } operator: { type: [string, "null"] } mode: { type: [string, "null"] } status: { type: [string, "null"] } departure_at: { type: string, format: date-time } arrival_at: { type: [string, "null"], format: date-time } trip_distance_km: { type: [number, "null"] } on_line_km: { type: number } on_line_seconds: type: [integer, "null"] description: Prorated by distance share; the trip store holds no intermediate timings. share_of_trip: { type: [number, "null"] } crossed: type: boolean description: | True on a crossing row. Crossing rows sit outside the distance partition — their kilometres are already inside the carrier line's. resolved_via: { type: [string, "null"], enum: [kmposts, override_pair, override_trip, null], } override_reason: { type: [string, "null"] } raw_route_km: type: [number, "null"] description: The registry kilometres before scaling. scale_factor: type: [number, "null"] description: | `distance_km / raw_route_km`. Stored rather than applied silently — a split that needed a large nudge is one to distrust. LineNotFoundResponse: type: object description: An unknown line name comes back with the closest registry matches, never empty. properties: error: { type: string } did_you_mean: type: array items: type: object properties: slug: { type: string } name: { type: string } kind: { type: string, enum: [line, crossing] } ReadingStatsResponse: type: object properties: total_books: { type: integer } books_with_pages: { type: integer } pages_coverage: { type: string, description: e.g. "22/25 books with known page counts"., } total_pages: { type: integer } avg_pages: { type: [integer, "null"] } median_pages: { type: [integer, "null"] } avg_pages_prose: { type: [integer, "null"], description: Average over prose only (excludes comics/graphic novels and audiobooks)., } prose_books: { type: integer } first_finished_at: { type: [string, "null"], format: date } last_finished_at: { type: [string, "null"], format: date } rating: type: object properties: avg: { type: [number, "null"] } count: { type: integer } distribution: type: object additionalProperties: { type: integer } by_format: type: array items: type: object properties: format: { type: string } books: { type: integer } total_pages: { type: integer } avg_pages: { type: [integer, "null"] } group_by: { type: string, enum: [year, month, format, author, rating, series, subject], } top: type: array items: type: object properties: key: { type: string } books: { type: integer } total_pages: { type: integer } avg_pages: { type: [integer, "null"] } filters: { type: object } ReadingPaceCycle: type: object properties: title: { type: [string, "null"] } author: { type: [string, "null"] } book_url: { type: [string, "null"] } cycle: { type: integer, description: 1-based readthrough ordinal for this book; >1 is a reread., } is_reread: { type: boolean } started_date: { type: [string, "null"], format: date } started_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null] } finished_date: { type: [string, "null"], format: date } finished_source: { type: [string, "null"], enum: [bookwyrm, storygraph, null] } days_to_finish: { type: [integer, "null"], description: Calendar days start→finish inclusive (same-day = 1); null without a known start., } pages: { type: [integer, "null"] } pages_per_day: { type: [number, "null"] } ReadingPaceResponse: type: object properties: books: type: array items: { $ref: "#/components/schemas/ReadingPaceCycle" } summary: type: object properties: books_finished: { type: integer } avg_days_to_finish: { type: [integer, "null"] } median_days_to_finish: { type: [integer, "null"] } avg_pages_per_day: { type: [number, "null"] } fastest: type: [object, "null"] properties: title: { type: [string, "null"] } days: { type: [integer, "null"] } slowest: type: [object, "null"] properties: title: { type: [string, "null"] } days: { type: [integer, "null"] } rereads: { type: integer } max_concurrent_books: { type: integer } start_coverage: { type: string, description: e.g. "38/41 finished cycles with a known start date"., } overlaps: type: array items: type: object properties: books: { type: array, items: { type: string } } from: { type: string, format: date } to: { type: string, format: date } filters: { type: object } GardenPagesResponse: type: object properties: count: { type: integer, description: Number of pages returned (after filter + limit)., } total: { type: integer, description: Total pages in the garden (before filter)., } sections: type: array items: type: object properties: section: { type: string } count: { type: integer } content_missing: type: integer description: Present only when include_content=true; number of returned pages whose content is not yet synced (content is null). pages: type: array items: type: object properties: title: { type: string } url: { type: string, format: uri } path: type: string description: Permalink, e.g. /reisar/interrail/2025 section: { type: string } description: { type: [string, "null"] } image: { type: [string, "null"] } date: { type: [string, "null"] } tags: type: array items: { type: string } content: type: [string, "null"] description: Present only when include_content=true. The page's full markdown text (frontmatter stripped); null when the note has not been synced yet. content_fetched_at: type: [string, "null"] format: date-time description: Present only when include_content=true. When the content was last fetched from Obsidian Publish. GardenPageResponse: type: object properties: title: { type: string } url: { type: string, format: uri } path: type: string description: Permalink, e.g. /reisar/interrail/2025 ("/" is the home page). section: type: [string, "null"] description: Null for the home page, which the page list omits. description: { type: [string, "null"] } image: { type: [string, "null"] } date: { type: [string, "null"] } tags: type: array items: { type: string } content: type: [string, "null"] description: The complete note body as markdown (frontmatter stripped); null when the source is currently unreachable. content_fetched_at: { type: [string, "null"], format: date-time } content_error: type: [string, "null"] description: Last fetch error when content is null; null otherwise. # ---- ActivityPub / discovery ---- WebfingerJrd: type: object properties: subject: { type: string } aliases: type: array items: { type: string } links: type: array items: type: object properties: rel: { type: string } type: { type: string } href: { type: string, format: uri } HostMetaJrd: type: object properties: links: type: array items: type: object properties: rel: { type: string, example: lrdd } type: { type: string, example: application/jrd+json } template: type: string example: https://bot.skvip.lol/.well-known/webfinger?resource={uri} NodeInfoLinks: type: object properties: links: type: array items: type: object properties: rel: { type: string } href: { type: string, format: uri } NodeInfo20: type: object properties: version: { type: string, example: "2.0" } software: type: object properties: name: { type: string } version: { type: string } protocols: type: array items: { type: string } services: type: object description: Required by the schema even when empty — this host bridges no third-party service. properties: inbound: { type: array, items: { type: string } } outbound: { type: array, items: { type: string } } usage: type: object properties: users: type: object properties: total: { type: integer } activeMonth: { type: integer } activeHalfyear: { type: integer } localPosts: type: integer description: Notes the bot has published. 0 if the database is unreachable. openRegistrations: { type: boolean } metadata: type: object properties: nodeName: { type: string } nodeDescription: { type: string } NodeInfo21: allOf: - $ref: "#/components/schemas/NodeInfo20" - type: object properties: version: { type: string, example: "2.1" } software: type: object properties: name: { type: string } version: { type: string } repository: { type: string, format: uri } Actor: type: object description: ActivityPub actor document. Typed `Service`, because this is a bot. properties: "@context": oneOf: - type: string - type: array items: oneOf: - type: string - type: object additionalProperties: { type: string } id: { type: string, format: uri } type: { type: string, example: Service } preferredUsername: { type: string } name: { type: string } summary: type: string description: HTML bio — who operates the bot, what it archives, what it stores about others. url: type: string format: uri description: The human-readable profile page (`/@{username}`), not the actor id. published: type: string format: date-time description: When this actor went live, from `ACTOR_PUBLISHED`. manuallyApprovesFollowers: type: boolean description: Always `true`. Every incoming Follow is auto-rejected. discoverable: { type: boolean } attributedTo: type: string format: uri description: The operator's actor, from `OWNER_ACTOR`. Omitted when unset. attachment: type: array description: Profile metadata rows, as rendered by Mastodon. At most four. items: type: object properties: type: { type: string, example: PropertyValue } name: { type: string, example: Lagrar om deg } value: { type: string, example: Ingenting } icon: { $ref: "#/components/schemas/ActorImage" } image: { $ref: "#/components/schemas/ActorImage" } inbox: { type: string, format: uri } outbox: { type: string, format: uri } followers: { type: string, format: uri } following: { type: string, format: uri } endpoints: type: object properties: sharedInbox: { type: string, format: uri } publicKey: type: object properties: id: { type: string } owner: { type: string } publicKeyPem: { type: string } ActorImage: type: object description: Avatar or header image. Served from `/assets` with a content hash in the query. properties: type: { type: string, example: Image } mediaType: { type: string, example: image/png } url: { type: string, format: uri } Activity: type: object description: An ActivityPub activity (or bare object, which is wrapped in a synthetic `Create`). properties: "@context": oneOf: - type: string - type: array items: { type: object } id: { type: string, format: uri } type: { type: string, example: Create } actor: { type: string, format: uri } object: oneOf: - type: string - type: object required: [id, type] additionalProperties: true OrderedCollection: type: object properties: "@context": { type: string } id: { type: string, format: uri } type: { type: string, example: OrderedCollection } totalItems: { type: integer } orderedItems: type: array items: { type: string } OrderedCollectionPage: type: object properties: "@context": { type: string } id: { type: string, format: uri } type: { type: string, example: OrderedCollectionPage } partOf: { type: string, format: uri } orderedItems: type: array items: { type: object } next: { type: string, format: uri } ThreadWalkState: type: object description: The walker's own state. Reported alongside the results so an empty leaderboard because nothing has been walked yet is distinguishable from one because nothing drew a reply. properties: blocked_reason: type: [string, "null"] description: Why a scheduled run would do nothing, or null when the walker can run. interval_hours: { type: integer } settled_days: type: integer description: A thread whose newest node is at least this old is settled; the daily pass skips it and only a backfill revisits it. last_walk_at: { type: [string, "null"], format: date-time } roots_total: { type: integer } roots_walked: { type: integer } roots_unsettled: { type: integer } roots_failing: type: integer description: Roots whose last walk failed. Their previously stored tree is kept, not emptied. ThreadLeaderboardRow: type: object properties: root_ap_id: { type: string, format: uri } actor_ap_id: { type: string, format: uri } url: { type: [string, "null"], format: uri } published_at: { type: [string, "null"], format: date-time } text: type: [string, "null"] description: The ROOT toot's own text. No reply text is returned, because none is stored. node_count: type: integer description: Every node in the tree, the root included. external_node_count: type: integer description: Nodes somebody else wrote. Always at least 1 — a thread of only his own replies is not listed. max_depth: { type: integer, description: Hops from the root. } external_participant_count: { type: integer } newest_node_at: { type: [string, "null"], format: date-time } settled: { type: boolean } walked_at: { type: [string, "null"], format: date-time } ThreadLeaderboardResponse: type: object properties: walk: { $ref: "#/components/schemas/ThreadWalkState" } actors: type: array items: type: object properties: actor_ap_id: { type: string, format: uri } handle: { type: string } sort: { type: string, enum: [external_nodes, depth, participants] } threads: type: array items: { $ref: "#/components/schemas/ThreadLeaderboardRow" } ThreadNode: type: object description: One node of the tree. Ids, a permalink, a handle, a depth and a timestamp — nothing about what was said, and nothing else about who said it. properties: id: { type: string, format: uri, description: The canonical AP id. } status_id: { type: string, description: The id local to `origin`. } origin: { type: string, description: The host that minted the status. } url: { type: [string, "null"], format: uri } handle: type: string description: "`@user@host`. The only piece of data about an external participant that is stored." example: "@someone@mastodon.social" depth: { type: integer, description: Hops from the root. The root is 0. } published_at: { type: [string, "null"], format: date-time } is_mine: { type: boolean } is_root: { type: boolean } ThreadTreeResponse: type: object properties: root: type: object properties: root_ap_id: { type: string, format: uri } actor_ap_id: { type: string, format: uri } url: { type: [string, "null"], format: uri } published_at: { type: [string, "null"], format: date-time } text: type: [string, "null"] description: The root toot's own text. The only text in this response. stats: type: object properties: node_count: { type: integer } external_node_count: { type: integer } max_depth: { type: integer } external_participant_count: { type: integer } newest_node_at: { type: [string, "null"], format: date-time } settled: { type: boolean } walked_at: { type: [string, "null"], format: date-time } nodes: type: array items: { $ref: "#/components/schemas/ThreadNode" } edges: type: array description: Parent→child links, ready for a graph layout. items: type: object properties: from: { type: string, format: uri } to: { type: string, format: uri } participants: type: array description: The distinct external handles in the thread, sorted. items: { type: string }