Skip to content
Ona Docs

GetAuthenticatedUser

client.users.getAuthenticatedUser(UserGetAuthenticatedUserParams { empty } body, RequestOptionsoptions?): UserGetAuthenticatedUserResponse { user }
POST/gitpod.v1.UserService/GetAuthenticatedUser

Gets information about the currently authenticated user.

Use this method to:

  • Get user profile information
  • Check authentication status
  • Retrieve user settings
  • Verify account details

Examples

  • Get current user:

    Retrieves details about the authenticated user.

    {}
ParametersExpand Collapse
body: UserGetAuthenticatedUserParams { empty }
empty?: boolean
ReturnsExpand Collapse
UserGetAuthenticatedUserResponse { user }
user: User { id, avatarUrl, createdAt, 4 more }
id: string

id is a UUID of the user

formatuuid
avatarUrl?: string

avatar_url is a link to the user avatar

createdAt?: string

created_at is the creation time

formatdate-time
email?: string

email is the user’s email address

name?: string

name is the full name of the user

organizationId?: string

organization_id is the id of the organization this account is owned by.

+optional if not set, this account is owned by the installation.

formatuuid
status?: UserStatus

status is the status the user is in

One of the following:
"USER_STATUS_UNSPECIFIED"
"USER_STATUS_ACTIVE"
"USER_STATUS_SUSPENDED"
"USER_STATUS_LEFT"

GetAuthenticatedUser

import Gitpod from '@gitpod/sdk';

const client = new Gitpod({
  bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});

const response = await client.users.getAuthenticatedUser();

console.log(response.user);
{
  "user": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "avatarUrl": "avatarUrl",
    "createdAt": "2019-12-27T18:11:19.117Z",
    "email": "email",
    "name": "name",
    "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "status": "USER_STATUS_UNSPECIFIED"
  }
}
Returns Examples
{
  "user": {
    "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "avatarUrl": "avatarUrl",
    "createdAt": "2019-12-27T18:11:19.117Z",
    "email": "email",
    "name": "name",
    "organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    "status": "USER_STATUS_UNSPECIFIED"
  }
}