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

# List Stored Sync Runs

> Stored sync runs for a user, newest first.

Unlike /sync/runs this reads from the database rather than the Redis event buffer,
so it is not limited to the last 24 hours. Only historical runs are stored by default.
Use /sync/history/{run_key} for the per-data-type breakdown.

`since` filters on when a run executed. `covered_from` / `covered_to` filter on the span
of data it was meant to cover, which is what answers "what ran that was supposed to cover
March" — a backfill started yesterday covering March matches. A run matches when its own
window overlaps the range or when any of its data types covered a span that does; runs
with no recorded window on either level are excluded, since overlap is undecidable.



## OpenAPI

````yaml https://api.openwearables.io/openapi.json get /api/v1/users/{user_id}/sync/history
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/users/{user_id}/sync/history:
    get:
      tags:
        - 'External: Sync Status'
      summary: List Stored Sync Runs
      description: >-
        Stored sync runs for a user, newest first.


        Unlike /sync/runs this reads from the database rather than the Redis
        event buffer,

        so it is not limited to the last 24 hours. Only historical runs are
        stored by default.

        Use /sync/history/{run_key} for the per-data-type breakdown.


        `since` filters on when a run executed. `covered_from` / `covered_to`
        filter on the span

        of data it was meant to cover, which is what answers "what ran that was
        supposed to cover

        March" — a backfill started yesterday covering March matches. A run
        matches when its own

        window overlaps the range or when any of its data types covered a span
        that does; runs

        with no recorded window on either level are excluded, since overlap is
        undecidable.
      operationId: list_stored_sync_runs_api_v1_users__user_id__sync_history_get
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            default: 20
            title: Limit
        - name: scope
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/SyncScope'
              - type: 'null'
            description: Filter by historical or live.
            title: Scope
          description: Filter by historical or live.
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only runs started at or after this time.
            title: Since
          description: Only runs started at or after this time.
        - name: provider
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Filter by provider name.
            title: Provider
          description: Filter by provider name.
        - name: covered_from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only runs whose covered data window ends after this time.
            title: Covered From
          description: Only runs whose covered data window ends after this time.
        - name: covered_to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            description: Only runs whose covered data window starts before this time.
            title: Covered To
          description: Only runs whose covered data window starts before this time.
        - name: X-Open-Wearables-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Open-Wearables-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SyncRunRecord'
                title: >-
                  Response List Stored Sync Runs Api V1 Users  User Id  Sync
                  History Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    SyncScope:
      type: string
      enum:
        - historical
        - live
      title: SyncScope
      description: Whether the run backfills history or delivers current data.
    SyncRunRecord:
      properties:
        run_key:
          type: string
          title: Run Key
        user_id:
          type: string
          format: uuid
          title: User Id
        provider:
          type: string
          title: Provider
        source:
          $ref: '#/components/schemas/SyncSource'
        scope:
          $ref: '#/components/schemas/SyncScope'
        status:
          $ref: '#/components/schemas/SyncStatus'
        trace_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Trace Id
        window_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window Start
        window_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Window End
        started_at:
          type: string
          format: date-time
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        items_inserted:
          type: integer
          title: Items Inserted
          default: 0
        items_updated:
          type: integer
          title: Items Updated
          default: 0
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
      type: object
      required:
        - run_key
        - user_id
        - provider
        - source
        - scope
        - status
        - started_at
      title: SyncRunRecord
      description: >-
        A stored sync run. Unlike the Redis-backed summaries this is not time
        limited.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SyncSource:
      type: string
      enum:
        - pull
        - webhook
        - sdk
        - backfill
        - xml_import
        - linked_account
      title: SyncSource
      description: How the sync was initiated / what transport delivers data.
    SyncStatus:
      type: string
      enum:
        - in_progress
        - success
        - partial
        - failed
        - cancelled
        - skipped
        - unfinished
        - stale
      title: SyncStatus
      description: Overall outcome state for the run.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````