doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / Retrieve Account Info

Retrieve Account Info

Retrieves account details including the current user and organization ID.

$
Terminal
doctl account g

When To Use

During a security audit to verify account access rights.

Pro Tip

Use the `--format` flag to limit output to specific fields like ID or email address for scripting.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
$ doctl account get

ID: 12345678
Email: user@example.com
Status: Active

$ doctl account list

| ID        | Email              | Status  |
|-----------|--------------------|---------|
| 12345678  | user@example.com    | Active  |
| 87654321  | admin@example.com   | Active  |

Anatomy of Output

Understanding the result

User: user@example.com User Email

Email associated with the account.

Organization ID: 123456 Organization ID

Identifier for the organization associated with the account.

Account Status: Active Account Status

Indicates whether the account is active.

Power User Variants

Optimized versions

doctl account get --format 'json'

Retrieve account info in JSON format.

doctl account get --fields 'email'

Output only the user email.

Troubleshooting

Common pitfalls

Error: 403 Forbidden

Solution: Check user permissions; ensure your API token has adequate scopes.

Error: 500 Internal Server Error

Solution: Retry the request; if it persists, check for service outages.

Error: No such account

Solution: Verify the account details and confirm correct API token usage.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
g
g|get
The value supplied for g|get.

How To Run

Execution path

  1. Step 1

    Run `doctl account get` to retrieve your account details.

  2. Step 2

    Use `doctl account list` to view all accounts associated with your API token.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.