doctl Verified current stable Not installed? Documentation

Doctl / Run Doctl Command With Access Token

Run Doctl Command With Access Token

Execute a doctl command using a specified access token.

$
Terminal
doctl databases user <command> -t <access_token>

When To Use

When performing operations requiring elevated privileges in secured contexts.

Pro Tip

Use an access token with the least privileges; scoped tokens minimize security risk.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
doctl databases user <command> -t <access_token>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
$ doctl databases user list -t my_access_token

ID          Name          Database ID  Role
----------  ------------  ------------  --------
123456789  db_user_1     987654321    db-admin
987654321  db_user_2     123456789    db-read-only

Anatomy of Output

Understanding the result

Executing command: user create Command Executed

The command executed using the specified access token.

Response: 200 OK HTTP Status Code

Successful execution of the command.

Duration: 150ms Execution Duration

Time taken to execute the command.

Troubleshooting

Common pitfalls

Error: Invalid access token.

Solution: Check token correctness and expiration.

Error: Unauthorized action.

Solution: Ensure the token has permission to execute this command.

Error: Rate limit exceeded.

Solution: Wait for quota reset before retrying.

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.
<command>
command
The value supplied for command.
<access_token>
access token
The value supplied for access token.
-t
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Replace {{command}} with 'list' in the doctl command.

  2. Step 2

    Insert your actual access token in place of {{access_token}}.

  3. Step 3

    Run the command in your terminal.

Alternative Approaches

Comparable commands in other tools

Alternative documentation tools for the same job.