Authentication
Secure your API requests with API key authentication
API Key Authentication
Conscherry Labs uses API keys for authentication. Each key is unique to your account and should be kept confidential.
Getting Your API Key
- Sign in to your account
- Go to Developer → API Keys dashboard
- Click "Generate New Key"
- Copy your key and store it securely
Making Authenticated Requests
Include your API key in the Authorization header:
Request Format
Authorization: Bearer sk_live_1a2b3c4d5e6f7g8h
cURL Example
1curl -H "Authorization: Bearer YOUR_API_KEY" \2 -H "Content-Type: application/json" \3 -X POST \4 -d '{"botId": "YOUR_BOT_ID", "guildCount": 1000, "userCount": 5000}' \5 https://labs.conscherry.com/api/v1/stats
Optional: clients may include non-sensitive telemetry headers to help with attribution and debugging. See the Telemetry & Attribution Headers section for recommended headers and batching guidance.
JavaScript/Node.js Example
1const response = await fetch('https://labs.conscherry.com/api/v1/stats', {2 method: 'POST',3 headers: {4 'Authorization': 'Bearer YOUR_API_KEY',5 'Content-Type': 'application/json',6 },7 body: JSON.stringify({8 botId: 'YOUR_BOT_ID',9 guildCount: 1000,10 userCount: 500011 })12});1314const data = await response.json();
Python Example
1import requests23headers = {4 'Authorization': 'Bearer YOUR_API_KEY',5 'Content-Type': 'application/json',6}78data = {9 'botId': 'YOUR_BOT_CLIENT_ID',10 'guildCount': 1000,11 'userCount': 5000,12}1314response = requests.post(15 'https://labs.conscherry.com/api/v1/stats',16 headers=headers,17 json=data,18)
Key Management
Permissions
Each API key can have specific permissions assigned. Only grant the permissions your integration needs:
read:botsRead bot informationwrite:statsPost and update statisticsread:statsRead statisticsread:profileRead your profile informationwrite:profileUpdate your profile
Rotating Keys
It's a best practice to rotate your API keys periodically. Here's how:
- Generate a new key
- Update your application to use the new key
- Revoke the old key
Revoking Keys
If a key is compromised, revoke it immediately from your dashboard. Once revoked, the key can no longer be used for authentication.
Best Practices
- ✓Store API keys in environment variables, not in code
- ✓Use HTTPS for all API requests
- ✓Rotate keys regularly (every 30-90 days)
- ✓Create separate keys for development and production
- ✓Monitor key usage in your dashboard
- ✓Revoke immediately if compromised
Need more help?
Ask in our Discord or email support@conscherry.com.