Some API methods require an authentication token. This token is a [JSON web token](https://en.wikipedia.org/wiki/JSON_Web_Token) that contains a list of "scopes" (i.e. permissions).
Once you obtain an API token (see below) you can pass it to the server in one of two ways:
- For GET/HEAD requests, use the `?token` query parameter
- For all other requests, use the `{token}` parameter as part of the JSON in the request body
### POST /\_auth
Creates and returns a new auth token. By default, auth tokens have the following scopes:
```json
{
"blacklist": {
"read": true
}
}
```
Required scope: none
Body parameters: none
Example:
```log
> curl -X POST "https://unpkg.com/_auth"
{
"token": "eyJhbGciOiJS..."
}
```
### GET /\_auth
Verifies and returns the payload contained in the given auth token.
The [public key](https://en.wikipedia.org/wiki/Public-key_cryptography) unpkg uses to encrypt authentication tokens, as JSON. You can also find the key as plain text [on GitHub](https://github.com/unpkg/unpkg/blob/master/public.key).