POST/user/v1/session:exchangeToken

Authenticate using ID token

Exchange an ID token from your IdP for an access token.

body parameters

  • token

    string

    Required

    The IdP ID token which is used to authenticated the user.

Returns

  • accessToken

    string

    An authorization token which can be used to make authenticated requests.

    This should be included in the Authorization header with a Bearer prefix.

  • expireTime

    date-time

    The expiration time for the session.

curl https://api.userhub.com/user/v1/session:exchangeToken \
  -H "UserHub-Api-Key: $USERHUB_USER_KEY" \
  --json '{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
  }'
Response bodyJSON
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expireTime": "2024-11-15T13:00:00Z"
}
PreviousGet session
NextCreate Portal session

Turn users intorevenue
$

Subscribe to monthly product updates

© 2025 UserHub

Integrations

    UserHub & Auth0UserHub & Stripe BillingUserHub & Google CloudUserHub & FirebaseUserHub & custom auth