> ## 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.

# Get Stored Sync Run

> One stored sync run with its per-data-type breakdown.



## OpenAPI

````yaml /openapi.json get /api/v1/sync/history/{run_key}
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/sync/history/{run_key}:
    get:
      tags:
        - 'External: Sync Status'
      summary: Get Stored Sync Run
      description: One stored sync run with its per-data-type breakdown.
      operationId: get_stored_sync_run_api_v1_sync_history__run_key__get
      parameters:
        - name: run_key
          in: path
          required: true
          schema:
            type: string
            title: Run Key
        - 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:
                $ref: '#/components/schemas/SyncRunDetail'
        '422':
          description: Validation Error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ValidationProblem'
        4XX:
          description: Client error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
        5XX:
          description: Server error
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    SyncRunDetail:
      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
        data_types:
          items:
            $ref: '#/components/schemas/SyncRunDataTypeRecord'
          type: array
          title: Data Types
      type: object
      required:
        - run_key
        - user_id
        - provider
        - source
        - scope
        - status
        - started_at
      title: SyncRunDetail
      description: >-
        A stored sync run with its per-data-type breakdown.


        Separate from SyncRunRecord so listing runs does not lazy-load the
        children.
    ValidationProblem:
      description: A 422 for a request that failed validation, listing every failure.
      examples:
        - code: VALIDATION_ERROR
          detail: >-
            body.email: value is not a valid email address: An email address
            must have an @-sign. (and 1 more)
          errors:
            - loc:
                - body
                - email
              msg: >-
                value is not a valid email address: An email address must have
                an @-sign.
              type: value_error
            - loc:
                - body
                - first_name
              msg: String should have at most 100 characters
              type: string_too_long
          status: 422
          title: Unprocessable Content
      properties:
        title:
          description: HTTP status phrase
          title: Title
          type: string
        status:
          description: HTTP status code, the same as the response's
          title: Status
          type: integer
        detail:
          description: Human-readable explanation of this occurrence
          title: Detail
          type: string
        code:
          description: Machine-readable error code, stable across releases
          title: Code
          type: string
        errors:
          description: Every validation failure in the request
          items:
            $ref: '#/components/schemas/ValidationErrorItem'
          title: Errors
          type: array
      required:
        - title
        - status
        - detail
        - code
        - errors
      title: ValidationProblem
      type: object
    Problem:
      description: >-
        An error response: RFC 9457 Problem Details, served as
        ``application/problem+json``.


        ``type`` is omitted, which per the RFC means ``about:blank``: ``title``
        is the status

        phrase, and ``code`` tells errors with the same status apart.
      examples:
        - code: NOT_FOUND
          detail: 'User with ID: 123e4567-e89b-12d3-a456-426614174000 not found.'
          status: 404
          title: Not Found
      properties:
        title:
          description: HTTP status phrase
          title: Title
          type: string
        status:
          description: HTTP status code, the same as the response's
          title: Status
          type: integer
        detail:
          description: Human-readable explanation of this occurrence
          title: Detail
          type: string
        code:
          description: Machine-readable error code, stable across releases
          title: Code
          type: string
      required:
        - title
        - status
        - detail
        - code
      title: Problem
      type: object
    SyncSource:
      type: string
      enum:
        - pull
        - webhook
        - sdk
        - backfill
        - xml_import
        - linked_account
      title: SyncSource
      description: How the sync was initiated / what transport delivers data.
    SyncScope:
      type: string
      enum:
        - historical
        - live
      title: SyncScope
      description: Whether the run backfills history or delivers current data.
    SyncStatus:
      type: string
      enum:
        - in_progress
        - success
        - partial
        - failed
        - cancelled
        - skipped
        - unfinished
        - stale
      title: SyncStatus
      description: Overall outcome state for the run.
    SyncRunDataTypeRecord:
      properties:
        data_type:
          type: string
          title: Data Type
        kind:
          $ref: '#/components/schemas/DataTypeKind'
        status:
          $ref: '#/components/schemas/SyncStatus'
        native_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Native Type
        reported_records:
          anyOf:
            - type: integer
            - type: 'null'
          title: Reported Records
        items_inserted:
          type: integer
          title: Items Inserted
          default: 0
        items_updated:
          type: integer
          title: Items Updated
          default: 0
        covered_start:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Covered Start
        covered_end:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Covered End
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Code
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
        attempt:
          type: integer
          title: Attempt
          default: 0
      type: object
      required:
        - data_type
        - kind
        - status
      title: SyncRunDataTypeRecord
      description: Stored outcome of one data type within a run.
    ValidationErrorItem:
      properties:
        loc:
          description: Where the invalid value is, e.g. ['body', 'email']
          items:
            anyOf:
              - type: string
              - type: integer
          title: Loc
          type: array
        msg:
          description: What is wrong with it
          title: Msg
          type: string
        type:
          description: Pydantic error type, e.g. 'missing'
          title: Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationErrorItem
      type: object
    DataTypeKind:
      type: string
      enum:
        - series
        - score
        - profile
        - event
        - task
      title: DataTypeKind
      description: >-
        What sort of thing a data type entry describes.


        Providers report at different granularities. SDK uploads report per
        series type,

        while REST pulls report per fetch task, and one task can write several
        series types.

        The kind records which of those a row represents so the two are not
        confused.
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /api/v1/auth/login

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.