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

# Bulk Trigger Historical Pull

> Create or submit link bulk trigger historical pull via the Junction API. Requires authentication with your team API key.

<Note>
  If you are planning to migrate connections, please [chat with us through support channels](/home/getting-support).
  Link Migration endpoints are disabled by default.
</Note>

### Asynchronous execution

The Bulk Trigger Historical Pull endpoint enqueues all trigger requests you submitted to a persistent background operation. It then responds
*202 Accepted* immediately afterwards.

You can inspect the status of the resulting background operation through the [List Bulk Ops](/api-reference/link/list-bulk-ops) endpoint.

Optionally, you may opt into the `wait_for_completion` mode, which would respond with 200 OK only if the operation does complete within 20 seconds.
Otherwise, the endpoint responds 202 Accepted.

<Note>
  You can trigger historical pull on any number of — or even all — connections through the Bulk Trigger Historical Pull API within a short period
  of time. Enqueuing is fast and does not disrupt the progress of the background operation.
</Note>

#### Managing provider API rate limits

Junction transparently batches and throttles the trigger requests. This is to avoid exhausting the provider API rate limits of your Bring Your Own OAuth
custom credentials.

You can submit as many trigger requests as needed.

| Provider            | Historical Pull Triggering Rate                                                                                                                                                |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Garmin              | 2 connections every 1 minute                                                                                                                                                   |
| Fitbit, Polar       | 250 connections at a time; no time-based throttling                                                                                                                            |
| Strava              | 1 connection every 15 minutes                                                                                                                                                  |
| Oura                | 150 connections every 5 minutes                                                                                                                                                |
| Withings            | 8 connections every 1 minute, assuming your app uses the [Withings Enterprise Plan](https://developer.withings.com/developer-guide/v3/withings-solutions/withings-api-plans/). |
| All other providers | 8 connections every 1 minute                                                                                                                                                   |

#### Historical Pull Range

Bulk Trigger Historical Pull respects any restricting [User Ingestion Bounds](/wearables/providers/data-ingestion-bounds) and/or any
[Team Data Pull Preferences](/wearables/providers/introduction#customizing-historical-data-pull-range) you have specified.

If you have specified a large number of days to pull, you should be aware that:

1. The background operation will take a longer time to run to completion.
2. It may still cause temporary disruption to data polling and webhook processing, even after the triggering has been throttled.


## OpenAPI

````yaml POST /v2/link/bulk_trigger_historical_pull
openapi: 3.1.0
info:
  title: Junction API
  description: https://docs.junction.com/
  version: 0.4.483
servers:
  - url: https://api.us.junction.com
    x-fern-server-name: Production
  - url: https://api.eu.junction.com
    x-fern-server-name: ProductionEU
  - url: https://api.sandbox.us.junction.com
    x-fern-server-name: Sandbox
  - url: https://api.sandbox.eu.junction.com
    x-fern-server-name: SandboxEU
security:
  - apiKeyAuth: []
paths:
  /v2/link/bulk_trigger_historical_pull:
    post:
      tags:
        - link
      summary: Bulk Trigger Historical Pull
      operationId: bulk_trigger_historical_pull_v2_link_bulk_trigger_historical_pull_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkTriggerHistoricalPullBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '202':
          description: Accepted
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BulkTriggerHistoricalPullBody:
      properties:
        user_ids:
          items:
            type: string
            format: uuid
          type: array
          title: User Ids
        provider:
          $ref: '#/components/schemas/OAuthProviders'
          description: ℹ️ This enum is non-exhaustive.
        wait_for_completion:
          type: boolean
          title: Wait For Completion
          description: >

            Whether or not the endpoint should wait for the Bulk Op to complete
            before responding.


            When `wait_for_completion` is enabled, the endpoint may respond 200
            OK if the Bulk Op takes less than 20 seconds to complete.


            Otherwise, the endpoint always responds with 202 Created once the
            submitted data have been enqueued successfully. You can use

            the [List Bulk
            Ops](https://docs.tryvital.io/api-reference/link/list-bulk-ops)
            endpoint to inspect the progress of the Bulk Op.
          default: false
      type: object
      required:
        - user_ids
        - provider
      title: BulkTriggerHistoricalPullBody
    HTTPValidationError:
      properties:
        detail:
          title: Detail
      type: object
      title: HTTPValidationError
    OAuthProviders:
      type: string
      enum:
        - oura
        - fitbit
        - garmin
        - strava
        - wahoo
        - ihealth
        - withings
        - google_fit
        - dexcom_v3
        - polar
        - cronometer
        - omron
        - whoop_v2
        - my_fitness_pal_v2
        - ultrahuman
        - runkeeper
      title: OAuthProviders
      description: ℹ️ This enum is non-exhaustive.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````