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

# API Key Authentication

> Learn how to authenticate with Datazone using API keys

# API Key Authentication

Datazone provides secure API key-based authentication for accessing its APIs and services.

## Obtaining an API Key

1. Log into your Datazone account
2. Navigate to Settings > API Keys
3. Click "Generate New Key"
4. Save the key securely - it won't be shown again

## Using API Keys

Include the API key in your requests:

```bash theme={null}
curl -H "Authorization: Bearer YOUR_API_KEY" https://api.datazone.co/v1/datasets
```

## API Key Best Practices

* Keep keys secure and never expose them in client-side code
* Rotate keys regularly
* Use different keys for different environments
* Limit key permissions to only what's needed

## Role-Based Access Control

### Available Roles

* **admin**: Full access to all resources
* **read\_only**: Read-only access to resources

## Error Handling

### Common Authentication Errors

| Status Code | Description              | Solution                         |
| ----------- | ------------------------ | -------------------------------- |
| 401         | Invalid API key          | Verify key is correct and active |
| 403         | Insufficient permissions | Check required roles             |
| 429         | Rate limit exceeded      | Implement backoff strategy       |
