## GetAuthenticatedUser `client.Users.GetAuthenticatedUser(ctx, body) (*UserGetAuthenticatedUserResponse, error)` **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. ```yaml {} ``` ### Parameters - `body UserGetAuthenticatedUserParams` - `Empty param.Field[bool]` ### Returns - `type UserGetAuthenticatedUserResponse struct{…}` - `User User` - `ID string` id is a UUID of the user - `AvatarURL string` avatar_url is a link to the user avatar - `CreatedAt Time` created_at is the creation 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. - `Status UserStatus` status is the status the user is in - `const UserStatusUnspecified UserStatus = "USER_STATUS_UNSPECIFIED"` - `const UserStatusActive UserStatus = "USER_STATUS_ACTIVE"` - `const UserStatusSuspended UserStatus = "USER_STATUS_SUSPENDED"` - `const UserStatusLeft UserStatus = "USER_STATUS_LEFT"` ### Example ```go package main import ( "context" "fmt" "github.com/gitpod-io/gitpod-sdk-go" "github.com/gitpod-io/gitpod-sdk-go/option" ) func main() { client := gitpod.NewClient( option.WithBearerToken("My Bearer Token"), ) response, err := client.Users.GetAuthenticatedUser(context.TODO(), gitpod.UserGetAuthenticatedUserParams{ }) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", response.User) } ``` #### Response ```json { "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" } } ```