GET/user/v1/session

Get session

Get the current session details.

Returns

  • user

    User

    The authenticated user.

    This will be null if the user is not authenticated.

  • memberships

    Membership[]

    The authenticated user's organization memberships.

  • subscription

    AccountSubscription

    The user's default active individual subscription.

    See memberships for organization subscription and seat information.

  • expireTime

    date-time

    The expiration time for the current session.

  • scopes

    string[]

    The scopes available in the current session.

curl https://api.userhub.com/user/v1/session \
  -H "UserHub-Api-Key: $USERHUB_USER_KEY" \
  -H "Authorization: Bearer $USER_ACCESS_TOKEN"
Response bodyJSON
{
  "user": {
    "id": "usr_MKFxzgJaAH8JQ4",
    "displayName": "Jane Doe",
    "email": "[email protected]",
    "emailVerified": true,
    "imageUrl": "https://example.com/jane.jpg"
  },
  "memberships": [],
  "subscription": null,
  "expireTime": "2024-11-15T13:00:00Z",
  "scopes": [
    "user.readwrite"
  ]
}
PreviousThe session object
NextAuthenticate using ID token

Turn users intorevenue
$

Subscribe to monthly product updates

© 2024 UserHub

Integrations

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