GetAccount
client.accounts.retrieve(AccountRetrieveParams { empty } body, RequestOptionsoptions?): AccountRetrieveResponse { account }
POST/gitpod.v1.AccountService/GetAccount
Gets information about the currently authenticated account.
Use this method to:
- Retrieve account profile information
- Check organization memberships
- View account settings
- Get joinable organizations
Examples
-
Get account details:
Retrieves information about the authenticated account.
{}
GetAccount
import Gitpod from '@gitpod/sdk';
const client = new Gitpod({
bearerToken: process.env['GITPOD_API_KEY'], // This is the default and can be omitted
});
const account = await client.accounts.retrieve();
console.log(account.account);{
"account": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"email": "email",
"name": "name",
"updatedAt": "2019-12-27T18:11:19.117Z",
"avatarUrl": "avatarUrl",
"joinables": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"organizationMemberCount": 0
}
],
"memberships": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"userRole": "ORGANIZATION_ROLE_UNSPECIFIED",
"organizationMemberCount": 0,
"organizationTier": "ORGANIZATION_TIER_UNSPECIFIED"
}
],
"organizationId": "organizationId",
"publicEmailProvider": true
}
}Returns Examples
{
"account": {
"id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"createdAt": "2019-12-27T18:11:19.117Z",
"email": "email",
"name": "name",
"updatedAt": "2019-12-27T18:11:19.117Z",
"avatarUrl": "avatarUrl",
"joinables": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"organizationMemberCount": 0
}
],
"memberships": [
{
"organizationId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"organizationName": "organizationName",
"userId": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
"userRole": "ORGANIZATION_ROLE_UNSPECIFIED",
"organizationMemberCount": 0,
"organizationTier": "ORGANIZATION_TIER_UNSPECIFIED"
}
],
"organizationId": "organizationId",
"publicEmailProvider": true
}
}