> ## 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 Sdk Sync Status

> Where the user's SDK sync for one provider stands, as the server sees it.

The server is the source of truth for sync progress; the device's own state is only a
cache. Call this after login, before starting a sync, to restore that state:

- `historicalSyncCompleted: true` - the historical export finished; only live sync is
  left, continuing from `syncedUntil`.
- `historicalSyncCompleted: false` - the export has not finished. It runs newest first, so
  each type in `dataTypes` with `historicalSyncCompleted: false` resumes backwards from its
  `exportedRange.startDate`. Types not listed have no data on the server yet.
- `historicalSyncCompleted: null` - no historical export on record: nothing synced yet, or
  an SDK version that does not send `syncSessionId`, so the server cannot tell. The same
  applies per type in `dataTypes`.
- `syncedUntil: null` and empty `dataTypes` - nothing synced yet; start a full export.

A user who has never synced gets that empty state with 200, not 404.



## OpenAPI

````yaml /openapi.json get /api/v1/sdk/users/{user_id}/sync/status
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/sdk/users/{user_id}/sync/status:
    get:
      tags:
        - 'External: Mobile SDK'
      summary: Get Sdk Sync Status
      description: >-
        Where the user's SDK sync for one provider stands, as the server sees
        it.


        The server is the source of truth for sync progress; the device's own
        state is only a

        cache. Call this after login, before starting a sync, to restore that
        state:


        - `historicalSyncCompleted: true` - the historical export finished; only
        live sync is
          left, continuing from `syncedUntil`.
        - `historicalSyncCompleted: false` - the export has not finished. It
        runs newest first, so
          each type in `dataTypes` with `historicalSyncCompleted: false` resumes backwards from its
          `exportedRange.startDate`. Types not listed have no data on the server yet.
        - `historicalSyncCompleted: null` - no historical export on record:
        nothing synced yet, or
          an SDK version that does not send `syncSessionId`, so the server cannot tell. The same
          applies per type in `dataTypes`.
        - `syncedUntil: null` and empty `dataTypes` - nothing synced yet; start
        a full export.


        A user who has never synced gets that empty state with 200, not 404.
      operationId: get_sdk_sync_status_api_v1_sdk_users__user_id__sync_status_get
      parameters:
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
        - name: provider
          in: query
          required: true
          schema:
            type: string
            description: SDK provider slug, e.g. `apple`, `samsung`, `health_connect`.
            title: Provider
          description: SDK provider slug, e.g. `apple`, `samsung`, `health_connect`.
        - 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/SDKSyncState'
        '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:
    SDKSyncState:
      properties:
        provider:
          type: string
          title: Provider
          description: Canonical SDK provider slug.
          examples:
            - apple
        historicalSyncCompleted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Historicalsynccompleted
          description: >-
            Whether a historical export for this provider has finished every
            data type it covered. False when one exists but has not finished.
            Null when there is no historical export on record: nothing synced
            yet, or an SDK version that does not send `syncSessionId`.
        syncedUntil:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Synceduntil
          description: >-
            Newest data held from this provider, across all types: where live
            sync continues from. Null when nothing has been synced yet.
          examples:
            - '2026-11-01T22:15:00Z'
        dataTypes:
          items:
            $ref: '#/components/schemas/SDKDataTypeSyncState'
          type: array
          title: Datatypes
          description: >-
            Data held per type from this provider. Empty when nothing has been
            synced yet.
      type: object
      required:
        - provider
        - historicalSyncCompleted
        - syncedUntil
      title: SDKSyncState
      description: >-
        Where the server says a user's SDK sync for one provider stands.


        The server is the source of truth: a device that lost its local state
        (e.g. after a

        logout) reads this to know where to resume from.
    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
    SDKDataTypeSyncState:
      properties:
        type:
          type: string
          title: Type
          description: >-
            Canonical data type: a series type slug (e.g. `heart_rate`) or an
            event category (`sleep`, `workout`).
          examples:
            - heart_rate
        kind:
          $ref: '#/components/schemas/DataTypeKind'
          description: '`series` for time series samples, `event` for sleep and workouts.'
        historicalSyncCompleted:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Historicalsynccompleted
          description: >-
            Whether a historical export finished this type. When false, resume
            it backwards from `exportedRange.startDate`. Null when no historical
            export reported this type, e.g. on SDK versions that do not send
            `syncSessionId`.
        lastSyncedAt:
          type: string
          format: date-time
          title: Lastsyncedat
          description: >-
            When data of this type was last written on the server. For data held
            before this was tracked, the time of its newest sample instead.
        coveredRange:
          $ref: '#/components/schemas/CoveredRange'
          description: >-
            Oldest and newest data held for this type from any sync. Gaps inside
            it are not shown, and retention moves its start forward, so it is no
            resume point.
        exportedRange:
          anyOf:
            - $ref: '#/components/schemas/CoveredRange'
            - type: 'null'
          description: >-
            What the latest historical export has sent of this type so far. The
            export runs newest first, so an unfinished type resumes backwards
            from `exportedRange.startDate`. Null when no export recorded a span,
            e.g. data synced before the server tracked it.
      type: object
      required:
        - type
        - kind
        - historicalSyncCompleted
        - lastSyncedAt
        - coveredRange
        - exportedRange
      title: SDKDataTypeSyncState
      description: What the server holds for one data type from this provider.
    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.
    CoveredRange:
      properties:
        startDate:
          type: string
          format: date-time
          title: Startdate
          description: Earliest timestamp in the span.
        endDate:
          type: string
          format: date-time
          title: Enddate
          description: Latest timestamp in the span.
      type: object
      required:
        - startDate
        - endDate
      title: CoveredRange
  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.