GET

/user/v1/session

Get session

Get 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: $USER_API_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-06-15T13:00:00Z",
  "scopes": [
    "user.readwrite"
  ]
}
PreviousThe session object
NextWebhooks

Turn users intorevenue
$

Subscribe to monthly product updates

© 2024 UserHub

Integrations

    UserHub & Auth0UserHub & Stripe BillingUserHub & Google CloudUserHub & FirebaseUserHub & Custom Auth