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

# Authentication

> How to authenticate with the CatchTheGoodOnes API

# Authentication

All API requests require a valid API key sent as a Bearer token in the `Authorization` header.

## Getting your API key

1. Log in to [CatchTheGoodOnes](https://www.catchthegoodones.com/sign-in)
2. Go to **Settings** - **API Key**
3. Click **Generate API Key**
4. Copy your key immediately - it is only shown once

API keys use the prefix `ctgo_` so you can identify them in your configuration.

## Using your API key

Include your key in the `Authorization` header of every request:

```bash theme={null}
curl https://www.catchthegoodones.com/api/v2/leads \
  -H "Authorization: Bearer ctgo_your_api_key_here"
```

## Key management

You can manage your API key from the [API Key page](https://www.catchthegoodones.com/settings/api):

* **Regenerate** - Creates a new key and immediately invalidates the old one
* **Revoke** - Permanently disables the key. You can generate a new one at any time.

## Error responses

If your key is missing, malformed, or revoked, the API returns a `401` status:

```json theme={null}
{
  "error": "Missing or invalid Authorization header. Use: Bearer <api_key>"
}
```

```json theme={null}
{
  "error": "Invalid API key format."
}
```

```json theme={null}
{
  "error": "Invalid or revoked API key."
}
```
