POST
/
v2
/
link
/
bulk_import
curl --request POST \
  --url https://api.tryvital.io/v2/link/bulk_import \
  --header 'Content-Type: application/json' \
  --header 'x-vital-api-key: <api-key>' \
  --data '{
  "provider": "oura",
  "connections": [
    {
      "user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "access_token": "<string>",
      "refresh_token": "<string>",
      "provider_id": "<string>",
      "expires_at": 123,
      "oauth_scopes": [
        "<string>"
      ]
    }
  ],
  "wait_for_completion": false
}'
{
  "user_ids_imported": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ],
  "user_ids_failed": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}

If you are planning to migrate connections, please chat with us through support channels. Link Migration endpoints are disabled by default.

Import existing provider connections to your Bring Your Own OAuth application credentials.

Before migrating any connection through this endpoint, you must first configure your BYOO app credential for the data provider on your Vital Team.

Note that these connections cannot be migrated:

  1. Any connection that is bound to an OAuth application credential not in your possession

  2. Any connection that is not bound to the OAuth application credential set on your Vital Team.

Asynchronous execution

The Bulk Import endpoint enqueues all connections you submitted to a persistent background operation. It then responds 202 Created immediately afterwards.

You can inspect the status of the resulting background operation through the List Bulk Ops endpoint.

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

You can submit any number of — or even all — connections through the Bulk Import API within a short period of time. Enqueuing is fast and does not disrupt the progress of the background operation.

Authorizations

x-vital-api-key
string
header
required

Vital Team API Key

Body

application/json
provider
enum<string>
required

ℹ️ This enum is non-exhaustive.

Available options:
oura,
fitbit,
garmin,
strava,
wahoo,
ihealth,
withings,
google_fit,
dexcom_v3,
polar,
cronometer,
omron,
whoop_v2,
my_fitness_pal_v2,
ultrahuman
connections
object[]
required
wait_for_completion
boolean
default:false

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 endpoint to inspect the progress of the Bulk Op.

Response

200
application/json
Successful Response
user_ids_imported
string[]
required
user_ids_failed
string[]
required