# How to Create an Access Token

## GitHub Personal Access Token

If [GitHub CLI](https://cli.github.com/) is installed and set up on your computer, av CLI automatically uses the same credential for interacting with GitHub. Alternatively, you can create a personal access token (classic) to authenticate with GitHub on your behalf.

1. Navigate to <https://github.com/settings/tokens/new>.
2. Create a name and expiration for your token.
   * The generated token should have the `repo` scope (all other scopes can be left un-checked).

![Required permissions for the GitHub personal access token that you will use with av](/files/ieFzQbSZv8gDrqOclBcO)

Put the created Personal Access Token in `~/.av/config.yaml`.

<pre class="language-yaml" data-title="~/.av/config.yaml" data-line-numbers><code class="lang-yaml"><strong>github:
</strong>    token: "ghp_abcdefghijklmnop"
</code></pre>

## Aviator User Access Token

User Access Tokens are used to authenticate with the Aviator REST API and Aviator GraphQL API.

1. Navigate to <https://app.aviator.co/settings/personal/api_token>.
2. Create a name and expiration for your token.
   * The token should be in the format `av_uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`. Add it to your Aviator configuration file `~/.av/config.yaml` as shown below.

{% code title="\~/.av/config.yaml" lineNumbers="true" %}

```yaml
aviator:
    apiToken: "av_uat_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```

{% endcode %}

You can verify that your token works with `av auth`.

```
$ av auth
Logged in to GitHub as <your_email>.
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aviator.co/aviator-cli/how-to-guides/create-a-user-access-token.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
