GetUser
client.users.getUser(UserGetUserParams { userId } body, RequestOptionsoptions?): UserGetUserResponse { user }
POST/gitpod.v1.UserService/GetUser
Gets basic information about a specific user by their ID.
Use this method to:
- Retrieve user profile information
- Get user details for display purposes
- Fetch user metadata for administrative tasks
Examples
-
Get user by ID:
Retrieves basic user information by user ID.
userId: "f53d2330-3795-4c5d-a1f3-453121af9c60"
GetUser
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.getUser({ userId: 'f53d2330-3795-4c5d-a1f3-453121af9c60' });
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"
}
}