> For the complete documentation index, see [llms.txt](https://docs.stopbot.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stopbot.net/v2/api-v2-documentation/authentication.md).

# Authentication

Every STOPBOT API request requires an API key. The API key identifies your account and allows STOPBOT to process requests for your services.

Authentication is used across all endpoints, including Account, Blocker, Blocker V2, SmartURLs, IP Lookup, Email Validation, and Phone Number Identify.

### API Key Parameter

Send your API key using the `apikey` query parameter.

```
apikey={API_KEY}
```

Example:

```
https://api.stopbot.net/services/account?apikey={API_KEY}
```

### Authenticated Request Examples

Account:

```bash
curl "https://api.stopbot.net/services/account?apikey={API_KEY}"
```

IP Lookup:

```bash
curl "https://api.stopbot.net/services/iplookup?apikey={API_KEY}&ip=1.1.1.1"
```

Blocker:

```bash
curl "https://api.stopbot.net/services/blocker?apikey={API_KEY}&ip=1.1.1.1&ua={USER_AGENT}&url={URL}"
```

SmartURLs:

```bash
curl "https://api.stopbot.net/services/shorterlink?apikey={API_KEY}&ip=1.1.1.1&keyname={KEYNAME}&ua={USER_AGENT}&url={URL}"
```

### API Key Format

API keys must use alphanumeric characters.

```
A-Z a-z 0-9
```

Use the full API key exactly as provided in the STOPBOT panel.

### Security Recommendations

* Keep your API key on the server side.
* Do not expose your API key in browser-only JavaScript.
* Do not commit your API key to public repositories.
* Do not place your API key in mobile app bundles.
* Rotate your API key if it has been exposed.
* Use environment variables or server-side configuration for production.

### Common Authentication Errors

Invalid API key format:

```json
{
  "errorMessage": "Apikey format is invalid.",
  "status": "failed"
}
```

API key not found:

```json
{
  "status": "failed",
  "errorMessage": "API key not found. Please check your API key or create a new one."
}
```

### Authenticated Access Errors

These errors can appear after an API key is recognized, but the request cannot continue because account access is not available.

Subscription expired or quota limit reached:

```json
{
  "status": "failed",
  "errorMessage": "Please increase your quota or extend the duration of your API key."
}
```

### Next Step

After your API key is ready, continue to the endpoint that matches your integration needs.
