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

# Sync User Data

> Synchronize data from fitness provider API for a specific user.

**Data Types:**
- `workouts`: Workouts/exercises/activities
- `247`: 24/7 data including sleep, recovery, and activity samples
- `all`: All available data types

**Provider-specific:**
- **Suunto**: Supports workouts and 247 data with pagination
- **Polar**: Supports workouts (exercises) only
- **Garmin**: Data arrives via webhooks (backfill for 30-day history)
- **Whoop**: Supports workouts and 247 data (sleep/recovery)

**Execution Mode:**
- `async=true` (default): Dispatches sync to background Celery worker. Returns immediately with task ID.
- `async=false`: Executes synchronously (may timeout for large data sets).

Requires valid API key and active connection for the user.



## OpenAPI

````yaml https://api.openwearables.io/openapi.json post /api/v1/providers/{provider}/users/{user_id}/sync
openapi: 3.1.0
info:
  title: Open Wearables API
  version: 0.1.0
servers: []
security: []
paths:
  /api/v1/providers/{provider}/users/{user_id}/sync:
    post:
      tags:
        - 'External: Data Sync'
      summary: Sync User Data
      description: >-
        Synchronize data from fitness provider API for a specific user.


        **Data Types:**

        - `workouts`: Workouts/exercises/activities

        - `247`: 24/7 data including sleep, recovery, and activity samples

        - `all`: All available data types


        **Provider-specific:**

        - **Suunto**: Supports workouts and 247 data with pagination

        - **Polar**: Supports workouts (exercises) only

        - **Garmin**: Data arrives via webhooks (backfill for 30-day history)

        - **Whoop**: Supports workouts and 247 data (sleep/recovery)


        **Execution Mode:**

        - `async=true` (default): Dispatches sync to background Celery worker.
        Returns immediately with task ID.

        - `async=false`: Executes synchronously (may timeout for large data
        sets).


        Requires valid API key and active connection for the user.
      operationId: sync_user_data_api_v1_providers__provider__users__user_id__sync_post
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/ProviderName'
            description: Data provider
          description: Data provider
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: User Id
        - name: data_type
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/SyncDataType'
            description: >-
              Type of data to sync: workouts, 247 (sleep/recovery/activity), or
              all
            default: all
          description: >-
            Type of data to sync: workouts, 247 (sleep/recovery/activity), or
            all
        - name: since
          in: query
          required: false
          schema:
            type: integer
            description: Unix timestamp to synchronize data since (0 = all, Suunto only)
            default: 0
            title: Since
          description: Unix timestamp to synchronize data since (0 = all, Suunto only)
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            description: 'Maximum number of items (Suunto: max 100)'
            default: 50
            title: Limit
          description: 'Maximum number of items (Suunto: max 100)'
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            description: Offset for pagination (Suunto only)
            default: 0
            title: Offset
          description: Offset for pagination (Suunto only)
        - name: filter_by_modification_time
          in: query
          required: false
          schema:
            type: boolean
            description: Filter by modification time instead of creation time (Suunto only)
            default: true
            title: Filter By Modification Time
          description: Filter by modification time instead of creation time (Suunto only)
        - name: samples
          in: query
          required: false
          schema:
            type: boolean
            description: Synchronize sample data (Polar only)
            default: false
            title: Samples
          description: Synchronize sample data (Polar only)
        - name: zones
          in: query
          required: false
          schema:
            type: boolean
            description: Synchronize zones data (Polar only)
            default: false
            title: Zones
          description: Synchronize zones data (Polar only)
        - name: route
          in: query
          required: false
          schema:
            type: boolean
            description: Synchronize route data (Polar only)
            default: false
            title: Route
          description: Synchronize route data (Polar only)
        - name: summary_start_time
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Activity start time as Unix timestamp or ISO 8601 date (Garmin
              only)
            title: Summary Start Time
          description: Activity start time as Unix timestamp or ISO 8601 date (Garmin only)
        - name: summary_end_time
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Activity end time as Unix timestamp or ISO 8601 date (Garmin only)
            title: Summary End Time
          description: Activity end time as Unix timestamp or ISO 8601 date (Garmin only)
        - name: async
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Run sync asynchronously via Celery (default: true). Set false for
              sync.
            default: true
            title: Async
          description: >-
            Run sync asynchronously via Celery (default: true). Set false for
            sync.
        - 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: object
                additionalProperties:
                  anyOf:
                    - type: boolean
                    - additionalProperties: true
                      type: object
                    - type: string
                title: >-
                  Response Sync User Data Api V1 Providers  Provider  Users 
                  User Id  Sync Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    ProviderName:
      type: string
      enum:
        - apple
        - samsung
        - google
        - garmin
        - polar
        - suunto
        - whoop
        - strava
        - oura
        - fitbit
        - ultrahuman
        - unknown
        - internal
      title: ProviderName
      description: Supported data providers.
    SyncDataType:
      type: string
      enum:
        - workouts
        - '247'
        - all
      title: SyncDataType
      description: Types of data to sync from provider.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````