> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rewind.rest/llms.txt
> Use this file to discover all available pages before exploring further.

# Sync health status

> Returns the latest sync status for each data domain, including last sync time, items synced, duration, and 24-hour error rate.



## OpenAPI

````yaml get /v1/health/sync
openapi: 3.1.0
info:
  title: Rewind API
  version: 1.0.0
  description: >-
    Personal data aggregation API. Syncs and serves data from Last.fm, Apple
    Music, Strava, Plex, Letterboxd, Discogs, Trakt, Instapaper, Google
    Calendar, and Gmail.


    ## Domains


    | Domain | Source | Description |

    |--------|--------|-------------|

    | **Listening** | Last.fm, Apple Music | Scrobbles, top
    artists/albums/tracks, streaks, stats |

    | **Running** | Strava | Activities, splits, gear, personal records, year
    summaries |

    | **Watching** | Plex, Letterboxd | Movies, TV shows, watch history,
    ratings, reviews |

    | **Collecting** | Discogs, Trakt | Vinyl/CD collection, physical media,
    wantlist |

    | **Reading** | Instapaper | Articles, highlights, reading progress, word
    count |

    | **Attending** | Google Calendar, Gmail | Live events, tickets, sports
    games, concerts, venues |


    ## Authentication


    All endpoints require a Bearer token. There are two key types:


    - **Read keys** (`rw_live_...`) — access all GET endpoints

    - **Admin keys** (`rw_admin_...`) — access all endpoints including sync
    triggers and data management


    Pass your key in the Authorization header: `Authorization: Bearer
    rw_live_...`


    ## Pagination


    List endpoints return paginated responses:


    ```json

    {
      "data": [...],
      "pagination": { "page": 1, "limit": 20, "total": 150, "total_pages": 8 }
    }

    ```


    The activity feed uses cursor-based pagination instead.


    ## Quick Start


    ```bash

    # Check the API is up

    curl https://api.rewind.rest/v1/health


    # Fetch recent scrobbles (requires read key)

    curl -H "Authorization: Bearer rw_live_..." \
      https://api.rewind.rest/v1/listening/recent

    # Fetch running stats

    curl -H "Authorization: Bearer rw_live_..." \
      https://api.rewind.rest/v1/running/stats
    ```


    ## Errors


    All errors follow the same envelope:


    ```json

    { "error": "Not found", "status": 404 }

    ```


    Common status codes: 400 (bad request), 401 (unauthorized), 404 (not found),
    500 (server error).
  contact:
    url: https://github.com/pdugan20/rewind
servers:
  - url: https://api.rewind.rest
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Listening
    description: Last.fm scrobbles, top charts, streaks, and stats.
  - name: Running
    description: Strava activities, splits, gear, records, and year summaries.
  - name: Watching
    description: >-
      Movies, TV shows, watch history, ratings, and reviews from Plex and
      Letterboxd.
  - name: Collecting
    description: Vinyl/CD collection from Discogs and physical media from Trakt.
  - name: Reading
    description: Articles, highlights, and reading stats from Instapaper.
  - name: Attending
    description: >-
      Live events you bought tickets for — sports games, concerts, theater.
      Sourced from Google Calendar and ticket-vendor email.
  - name: Feed
    description: Cross-domain activity feed with cursor-based pagination.
  - name: Search
    description: Full-text search across all domains.
  - name: Images
    description: Image proxy with on-the-fly transforms via Cloudflare Images.
  - name: System
    description: Health checks and sync status.
  - name: Admin
    description: >-
      API key management, sync triggers, and data administration. Requires admin
      key.
  - name: Webhooks
    description: Inbound webhook receivers for Strava and Plex. No auth required.
paths:
  /v1/health/sync:
    get:
      tags:
        - System
      summary: Sync health status
      description: >-
        Returns the latest sync status for each data domain, including last sync
        time, items synced, duration, and 24-hour error rate.
      operationId: getHealthSync
      responses:
        '200':
          description: Sync status for all domains
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SyncHealthResponse'
              example:
                status: ok
                domains:
                  listening:
                    last_sync: '2026-03-18T21:00:00.000Z'
                    status: completed
                    sync_type: scrobbles
                    items_synced: 42
                    duration_ms: 1250
                    error: null
                    error_rate: 0
                  running:
                    last_sync: '2026-03-18T03:00:00.000Z'
                    status: completed
                    sync_type: activities
                    items_synced: 3
                    duration_ms: 4200
                    error: null
                    error_rate: 0
                enrichment:
                  artists_missing_apple_music_url_with_plays: 0
                  artists_missing_apple_music_url: 0
                  tracks_missing_itunes_enrichment: 0
                integrity:
                  lastfm_album_artist_mismatch_count: 0
components:
  schemas:
    SyncHealthResponse:
      type: object
      properties:
        status:
          type: string
          enum:
            - ok
        domains:
          type: object
          additionalProperties:
            type: object
            properties:
              last_sync:
                type:
                  - string
                  - 'null'
                format: date-time
              status:
                type: string
                example: completed
              sync_type:
                type: string
                example: scrobbles
              items_synced:
                type:
                  - integer
                  - 'null'
              duration_ms:
                type:
                  - integer
                  - 'null'
              error:
                type:
                  - string
                  - 'null'
              error_rate:
                type: number
                example: 0
            required:
              - last_sync
              - status
              - sync_type
              - items_synced
              - duration_ms
              - error
              - error_rate
        enrichment:
          type: object
          properties:
            artists_missing_apple_music_url_with_plays:
              type: integer
            artists_missing_apple_music_url:
              type: integer
            tracks_missing_itunes_enrichment:
              type: integer
          required:
            - artists_missing_apple_music_url_with_plays
            - artists_missing_apple_music_url
            - tracks_missing_itunes_enrichment
        integrity:
          type: object
          properties:
            lastfm_album_artist_mismatch_count:
              type: integer
          required:
            - lastfm_album_artist_mismatch_count
      required:
        - status
        - domains
        - enrichment
        - integrity
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key. Read keys (rw_live_...) access GET endpoints. Admin keys
        (rw_admin_...) access all endpoints.

````