GET
/user/v1/session
Get session
Get the current session details.
Returns
The authenticated user.
This will be null if the user is not authenticated.
The system-assigned identifier of the user.
The client defined unique identifier of the user account.
The human-readable display name of the user.
The email address of the user.
Whether the user's email address has been verified.
The photo/avatar URL of the user.
Whether the user is disabled.
The authenticated user's organization memberships.
The system-assigned identifier of the organization.
The client defined unique identifier of the organization account.
The human-readable display name of the organization.
The email address of the organization.
Whether the organization's email address has been verified.
The photo/avatar URL of the organization.
The number of members in the organization.
This includes disabled users, but does not include user's marked for deletion.
Whether the organization is disabled.
The user's role within the organization.
The system-assigned identifier of the role.
The client defined unique identifier of the role.
It is restricted to letters, numbers, underscores, and hyphens, with the first character a letter or a number, and a 255 character maximum.
ID's starting with role_
are reserved.
The human-readable display name of the role.
Possible values:OWNER
MEMBER
GUEST
The description of the role.
The maximum length is 1000 characters.
The additional permissions allowed by the role.
Whether the role is the default for the tenant.
subscription
AccountSubscription
The subscription associated with the organization.
The system-assigned identifier of the subscription.
The state of the subscription.
Possible values:TRIALING
CHECKOUT_ISSUE
ACTIVE
PAST_DUE
PAUSED
The anchor time of the billing cycle.
plan
AccountSubscriptionPlan
The identifier of the plan.
The human-readable display name of the plan.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
seat
AccountSubscriptionSeat
The user's seat.
This will only be set for organization subscriptions where the user has been assigned a seat.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
subscription
AccountSubscription
The user's default active individual subscription.
See memberships for organization subscription and seat information.
The system-assigned identifier of the subscription.
The state of the subscription.
Possible values:TRIALING
CHECKOUT_ISSUE
ACTIVE
PAST_DUE
PAUSED
The anchor time of the billing cycle.
plan
AccountSubscriptionPlan
The identifier of the plan.
The human-readable display name of the plan.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
seat
AccountSubscriptionSeat
The user's seat.
This will only be set for organization subscriptions where the user has been assigned a seat.
The system-assigned identifier of the product.
The client defined unique identifier of the product.
The human-readable display name of the product.
The expiration time for the current session.
The scopes available in the current session.
The general error code (e.g. INVALID_ARGUMENT
).
Possible values:OK
CANCELLED
UNKNOWN
INVALID_ARGUMENT
DEADLINE_EXCEEDED
NOT_FOUND
ALREADY_EXISTS
PERMISSION_DENIED
UNAUTHENTICATED
RESOURCE_EXHAUSTED
FAILED_PRECONDITION
ABORTED
OUT_OF_RANGE
UNIMPLEMENTED
INTERNAL
UNAVAILABLE
DATA_LOSS
A developer-facing error message.
A reason code for the error (e.g. USER_PENDING_DELETION
).
The parameter path related to the error (e.g. member.userId
).
Additional metadata related to the error.
A user-facing error message.
curl https://api.userhub.com/user/v1/session \
-H "UserHub-Api-Key: $USERHUB_USER_KEY" \
-H "Authorization: Bearer $USER_ACCESS_TOKEN"
const res = await userApi.session.get();
res, err := userApi.Session().Get(
context.Background(),
nil,
)
$res = $userApi->session->get();
res = user_api.session.get()
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"
]
}