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

> Create or submit link bulk export 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>

<Warning>
  You should [pause the connections](/api-reference/link/bulk-pause) before bulk exporting them. Pausing stops
  Junction systems from refreshing the connections, ensuring the exported data is the most up-to-date.
</Warning>


## OpenAPI

````yaml POST /v2/link/bulk_export
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_export:
    post:
      tags:
        - link
      summary: Bulk Export Connections
      operationId: bulk_export_connections_v2_link_bulk_export_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkExportConnectionsBody'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkExportConnectionsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BulkExportConnectionsBody:
      properties:
        user_ids:
          anyOf:
            - items:
                type: string
                format: uuid
              type: array
            - type: 'null'
          title: User Ids
        provider:
          $ref: '#/components/schemas/OAuthProviders'
          description: ℹ️ This enum is non-exhaustive.
        next_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Token
      type: object
      required:
        - provider
      title: BulkExportConnectionsBody
    BulkExportConnectionsResponse:
      properties:
        data:
          items:
            $ref: '#/components/schemas/ConnectionRecipe'
          type: array
          title: Data
        next_token:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Token
      type: object
      required:
        - data
        - next_token
      title: BulkExportConnectionsResponse
    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.
    ConnectionRecipe:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
          description: >-
            Vital User ID. The user must be created ahead of the bulk import
            operation.
        access_token:
          type: string
          title: Access Token
          description: |-
            * OAuth 2.0 providers (Fitbit, etc): The latest Access Token.
            * OAuth 1.0 providers (Garmin): The Access Token.
        refresh_token:
          type: string
          title: Refresh Token
          description: |-
            * OAuth 2.0 providers (Fitbit, etc): The latest Refresh Token.
            * OAuth 1.0 providers (Garmin): The Token Secret.
        provider_id:
          type: string
          title: Provider Id
          description: |-
            User ID of the data provider.

            * Fitbit: 6-character Fitbit User ID 
            * Garmin: 36-character Garmin User ID
        expires_at:
          type: integer
          title: Expires At
          description: >-
            Access token expiry date, in terms of UNIX epoch seconds.


            * OAuth 2.0 providers (Fitbit, etc): The latest expiry date on your
            record.

            * OAuth 1.0 providers (Garmin): Use the constant value `2147483647`.
        oauth_scopes:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Oauth Scopes
          description: |-
            OAuth scopes of the data provider. Specify `null` if you do not
            have any scopes on record.

            * Fitbit: Has scopes
            * Garmin: No scope
      type: object
      required:
        - user_id
        - access_token
        - refresh_token
        - provider_id
        - expires_at
      title: ConnectionRecipe
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: x-vital-api-key
      description: Vital Team API Key

````