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

# Authentication

> Authenticate ScoutLayer REST requests with an API key or bearer token.

Every ScoutLayer API request requires a valid credential. Send it in either supported header.

## Bearer token

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

```bash theme={null}
curl https://scoutlayer.io/api/v1/domains/example.com/whois \
  -H "Authorization: Bearer $SCOUTLAYER_API_KEY"
```

## X-API-Key

```http theme={null}
X-API-Key: YOUR_API_KEY
```

```bash theme={null}
curl https://scoutlayer.io/api/v1/domains/example.com/whois \
  -H "X-API-Key: $SCOUTLAYER_API_KEY"
```

## Create a key

Open [API Keys](https://scoutlayer.io/dashboard/api-keys), select **Create API key**, and copy the key when it appears.

<Warning>
  Store keys in environment variables or a secrets manager. Do not expose them in client-side code.
</Warning>

## Authentication errors

| Status                 | Meaning                                                                          |
| ---------------------- | -------------------------------------------------------------------------------- |
| `401 Unauthorized`     | The credential is missing or invalid.                                            |
| `403 Forbidden`        | The account email is not verified or the endpoint is unavailable to the account. |
| `402 Payment Required` | The account does not have enough credits for the request.                        |
