GET
/
user
/
connect
/
token
curl --request GET \
  --url https://api.sandbox.metriport.com/user/connect/token \
  --header 'x-api-key: <api-key>'
import { MetriportDevicesApi } from "@metriport/api-sdk";

const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");

const response = await metriportClient.getConnectToken("metriportUserId");

Query Params

userId
string
required

The Metriport user ID to create a session token for.

Response

token
string
required

The temporary token to allow the specified user to access the Metriport Connect widget.

The token will expire 10 minutes after it is created, and can be reused for the duration of the session.
{
  "token": "YXM-S_TFApXrAjLpfdmdG"
}