Link
Generate a link token
Endpoint to generate a user link token, to be used throughout the vital
link process. The vital link token is a one time use token, that
expires after 10 minutes. If you would like vital-link widget to launch
with a specific provider, pass in a provider in the body. If you would
like to redirect to a custom url after successful or error connection,
pass in your own custom redirect_url parameter.
POST
/
v2
/
link
/
token
Authorization
Body
curl --request POST \
--url {{BASE_URL}}/v2/link/token \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-vital-api-key: <API_KEY>' \
--data '
{
"user_id": "1875c190-0cd6-46c1-8670-5b56a7794b78"
}
'
{
"link_token": "dGVzdCB0ZXN0IHRlc3Q="
}
Authorizations
x-vital-api-key
string
headerrequiredAPI key based authentication
Body
application/json
filter_on_providers
enum<string>[]
Available options:
oura
, fitbit
, garmin
, whoop
, strava
, renpho
, peloton
, wahoo
, zwift
, freestyle_libre
, freestyle_libre_ble
, eight_sleep
, withings
, apple_health_kit
, manual
, ihealth
, google_fit
, beurer_api
, beurer_ble
, omron
, omron_ble
, onetouch_ble
, accuchek_ble
, contour_ble
, dexcom
, dexcom_v3
, hammerhead
, my_fitness_pal
, health_connect
, polar
, cronometer
, kardia
provider
enum<string>
An enumeration.
Available options:
oura
, fitbit
, garmin
, whoop
, strava
, renpho
, peloton
, wahoo
, zwift
, freestyle_libre
, freestyle_libre_ble
, eight_sleep
, withings
, apple_health_kit
, manual
, ihealth
, google_fit
, beurer_api
, beurer_ble
, omron
, omron_ble
, onetouch_ble
, accuchek_ble
, contour_ble
, dexcom
, dexcom_v3
, hammerhead
, my_fitness_pal
, health_connect
, polar
, cronometer
, kardia
redirect_url
string
user_id
string
requiredUser id returned by vital create user request. This id should be stored in your database against the user and used for all interactions with the vital api.
Response
200 - application/json
link_token
string
requiredLink token to use to launch link widget
curl --request POST \
--url {{BASE_URL}}/v2/link/token \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-vital-api-key: <API_KEY>' \
--data '
{
"user_id": "1875c190-0cd6-46c1-8670-5b56a7794b78"
}
'
{
"link_token": "dGVzdCB0ZXN0IHRlc3Q="
}