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

# Authentication

> Authenticate API requests and protect API keys.

Dock developer API endpoints use API-key authentication.

## API-key auth

Send your API key as a Bearer token.

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

> [!WARNING]
>
> API keys must stay server-side. Do not place them in frontend JavaScript, mobile apps, public Git repositories, Discord messages, screenshots, or logs.

```bash cURL theme={null}
curl --request GET \
  --url "https://api.docksys.xyz/api/v1/public/roblox-to-discord?robloxId=156319135&guildId=987654321098765432" \
  --header "Authorization: Bearer YOUR_API_KEY"
```

```javascript JavaScript theme={null}
const response = await fetch(
  "https://api.docksys.xyz/api/v1/public/roblox-to-discord?robloxId=156319135&guildId=987654321098765432",
  {
    headers: {
      Authorization: `Bearer ${process.env.DOCK_API_KEY}`,
    },
  },
);

const payload = await response.json();
```

```python Python theme={null}
import os
import requests

response = requests.get(
    "https://api.docksys.xyz/api/v1/public/roblox-to-discord",
    params={"robloxId": "156319135", "guildId": "987654321098765432"},
    headers={"Authorization": f"Bearer {os.environ['DOCK_API_KEY']}"},
)

payload = response.json()
```

## Key safety rules

**1. Use one key per integration scope**

Do not create extra keys to bypass quotas, restrictions, suspensions, or access controls.

**2. Rotate compromised keys**

If a key is exposed, revoke it and create a replacement from the dashboard.

**3. Restrict trusted hosts**

Use IP allowlists or denylists when a key should only run from known infrastructure.

**4. Log safely**

Log request IDs and status codes, not full API keys or sensitive account data.

## Common auth failures

**INVALID\_API\_KEY** `401`

The Bearer token is missing, invalid, expired, revoked, or disabled.

**PREMIUM\_REQUIRED** `403`

The endpoint or requested expansion requires a Premium key.

```json Auth error theme={null}
{
  "status": 401,
  "error": "Unauthorized: Invalid API key",
  "version": "1.0.0",
  "timestamp": "2026-05-07T00:00:00.000Z"
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.