GET

/user

x-api-key*
curl --request GET \
  --url https://api.sandbox.metriport.com/user \
  --header 'x-api-key: <x-api-key>'

Response

connectedUsersrequired
ConnectedUserInfo[]

All connected users, with details of their IDs and connected providers.

{
  "connectedUsers": [
    {
      "metriportUserId": "3a3a7677-25bb-4f1b-bf3c-6e0ff46ce905",
      "appUserId": "my-app-user-1"
    },
    {
      "metriportUserId": "951faef1-5cfd-464a-81f7-31f76edf309e",
      "appUserId": "my-app-user-2",
      "connectedProviders": ["fitbit", "cronometer"]
    }
  ]
}
import { MetriportDevicesApi } from "@metriport/api-sdk";
const metriportClient = new MetriportDevicesApi("YOUR_API_KEY");
const connectedUsers = await metriportClient.getConnectedUsers();