> ## Documentation Index
> Fetch the complete documentation index at: https://ona.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Account

> Gets information about the currently authenticated account.

`Unary` · [`Accounts`](/docs/api-reference/generated/account/overview)

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.

  ```yaml theme={null}
  {}
  ```

## Endpoint

```text theme={null}
POST /api/gitpod.v1.AccountService/GetAccount
```

Send a Bearer token as described in [Authentication](/docs/api-reference#authenticate-requests). If your organization uses a custom management-plane domain, replace `https://app.ona.com` with that domain.

## Request example

<CodeGroup>
  ```bash cURL theme={null}
  export ONA_HOST=https://app.ona.com
  export ONA_API_KEY=<your-token>

  curl --request POST \
    --url "$ONA_HOST/api/gitpod.v1.AccountService/GetAccount" \
    --header "Authorization: Bearer $ONA_API_KEY" \
    --header "Content-Type: application/json" \
    --data '{}'
  ```

  ```python Python theme={null}
  import gitpod.v1.account_pb2 as account_pb2
  from ona_sdk import create_client_from_env

  ona = create_client_from_env()
  request = account_pb2.GetAccountRequest()
  response = ona.services.account.get_account(request)
  print(response)
  ```

  ```typescript TypeScript theme={null}
  import { create } from "@bufbuild/protobuf";
  import { createClientFromEnv } from "@gitpod/sdk";
  import { GetAccountRequestSchema } from "@gitpod/sdk/gitpod/v1/account_pb";

  async function main() {
    const ona = createClientFromEnv();
    const request = create(GetAccountRequestSchema, {});
    const response = await ona.services.account.getAccount(request);
    console.log(response);
  }

  main().catch(console.error);
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"
  	"log"

  	"connectrpc.com/connect"
  	"github.com/gitpod-io/gitpod-sdk-go/sdk"
  	gitpodpb "github.com/gitpod-io/gitpod-sdk-go/v1"
  )

  func main() {
  	ona, err := sdk.NewFromEnv()
  	if err != nil {
  		log.Fatal(err)
  	}

  	request := connect.NewRequest(&gitpodpb.GetAccountRequest{})
  	response, err := ona.Services.Account.GetAccount(context.Background(), request)
  	if err != nil {
  		log.Fatal(err)
  	}
  	fmt.Println(response.Msg)
  }
  ```

  ```json Request body theme={null}
  {}
  ```
</CodeGroup>

## Request

`gitpod.v1.GetAccountRequest`

This message has no fields.

## Response

`gitpod.v1.GetAccountResponse`

| Field     | Type                               | Required | Description                   |
| --------- | ---------------------------------- | -------- | ----------------------------- |
| `account` | [Account](#type-gitpod-v1-account) | Yes      | Constraints: `required=true`. |

## Related types

<a id="type-gitpod-v1-account" />

<Accordion title="Account">
  `gitpod.v1.Account`

  | Field                 | Type                                                                   | Required | Description                                                                                               |
  | --------------------- | ---------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------- |
  | `id`                  | string                                                                 | Yes      | Constraints: `required=true, string.uuid=true`.                                                           |
  | `name`                | string                                                                 | Yes      | Constraints: `required=true`.                                                                             |
  | `avatarUrl`           | string                                                                 | No       |                                                                                                           |
  | `email`               | string                                                                 | Yes      | Constraints: `required=true`.                                                                             |
  | `createdAt`           | RFC 3339 timestamp                                                     | Yes      | Constraints: `required=true`.                                                                             |
  | `updatedAt`           | RFC 3339 timestamp                                                     | Yes      | Constraints: `required=true`.                                                                             |
  | `memberships`         | array of [AccountMembership](#type-gitpod-v1-account-membership)       | No       |                                                                                                           |
  | `joinables`           | array of [JoinableOrganization](#type-gitpod-v1-joinable-organization) | No       | **Deprecated.** joinables is deprecated. Use ListJoinableOrganizations instead.                           |
  | `publicEmailProvider` | boolean                                                                | No       | public\_email\_provider is true if the email for the Account matches a known public email provider        |
  | `organizationId`      | string                                                                 | No       | organization\_id is the ID of the organization the account is owned by if it's created through custom SSO |
</Accordion>

<a id="type-gitpod-v1-account-membership" />

<Accordion title="AccountMembership">
  `gitpod.v1.AccountMembership`

  | Field                     | Type                                                  | Required | Description                                                                                                            |
  | ------------------------- | ----------------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------- |
  | `userId`                  | string                                                | Yes      | user\_id is the ID the user has in the organization Constraints: `required=true, string.uuid=true`.                    |
  | `userRole`                | [OrganizationRole](#enum-gitpod-v1-organization-role) | Yes      | user\_role is the role the user has in the organization Constraints: `required=true`.                                  |
  | `organizationId`          | string                                                | Yes      | organization\_id is the id of the organization the user is a member of Constraints: `required=true, string.uuid=true`. |
  | `organizationName`        | string                                                | Yes      | organization\_name is the name of the organization the user is a member of Constraints: `required=true`.               |
  | `organizationMemberCount` | integer                                               | No       | organization\_member\_count is the member count of the organization the user is a member of                            |
  | `organizationTier`        | [OrganizationTier](#enum-gitpod-v1-organization-tier) | No       | organization\_tier is the tier of the organization (Free, Core, Enterprise)                                            |
</Accordion>

<a id="type-gitpod-v1-joinable-organization" />

<Accordion title="JoinableOrganization">
  `gitpod.v1.JoinableOrganization`

  | Field                     | Type    | Required | Description                                                                                                      |
  | ------------------------- | ------- | -------- | ---------------------------------------------------------------------------------------------------------------- |
  | `organizationId`          | string  | Yes      | organization\_id is the id of the organization the user can join Constraints: `required=true, string.uuid=true`. |
  | `organizationName`        | string  | Yes      | organization\_name is the name of the organization the user can join Constraints: `required=true`.               |
  | `organizationMemberCount` | integer | No       | organization\_member\_count is the member count of the organization the user can join                            |
</Accordion>

<a id="enum-gitpod-v1-organization-role" />

<Accordion title="OrganizationRole">
  | Value                           | Number | Description |
  | ------------------------------- | -----: | ----------- |
  | `ORGANIZATION_ROLE_UNSPECIFIED` |      0 |             |
  | `ORGANIZATION_ROLE_ADMIN`       |      1 |             |
  | `ORGANIZATION_ROLE_MEMBER`      |      2 |             |
</Accordion>

<a id="enum-gitpod-v1-organization-tier" />

<Accordion title="OrganizationTier">
  | Value                           | Number | Description |
  | ------------------------------- | -----: | ----------- |
  | `ORGANIZATION_TIER_UNSPECIFIED` |      0 |             |
  | `ORGANIZATION_TIER_FREE`        |      1 |             |
  | `ORGANIZATION_TIER_ENTERPRISE`  |      2 |             |
  | `ORGANIZATION_TIER_CORE`        |      3 |             |
  | `ORGANIZATION_TIER_FREE_ONA`    |      4 |             |
</Accordion>
