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

# Authentication

> Authenticate with TimeLockData API using API Keys

TimeLockData API uses **API Key** authentication for all requests.

## API Key Authentication

Include your API key in the `X-API-Key` header with every request.

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

### Getting Your API Key

1. Log in to the [TimeLockData Dashboard](https://app.timelockdata.com)
2. Navigate to **Administration > Source Systems**
3. Create a new source system to generate an API key
4. Copy the key and store it securely

### Example

<CodeGroup>
  ```bash curl theme={null}
  curl -X GET "https://api.timelockdata.com/api/v1/evidences/{COMPANY_ID}/category" \
    -H "X-API-Key: your-api-key"
  ```

  ```javascript fetch theme={null}
  const response = await fetch(
    `https://api.timelockdata.com/api/v1/evidences/${companyId}/category`,
    {
      headers: { 'X-API-Key': 'your-api-key' }
    }
  );
  const categories = await response.json();
  ```
</CodeGroup>

## Security Best Practices

* Store API keys in environment variables, never in source code
* Use HTTPS for all requests
* Rotate API keys periodically
* Use different keys for development and production

## Error Responses

**401 Unauthorized** — Missing or invalid API key:

```json theme={null}
{
  "statusCode": 401,
  "message": "Unauthorized"
}
```

**403 Forbidden** — Insufficient permissions:

```json theme={null}
{
  "statusCode": 403,
  "message": "Forbidden resource"
}
```
