API Keys API
Manage API keys for accessing BRDZ services. API keys are required for all API requests and provide authentication for your applications.
Generate SDK API Key (Public)
Generate SDK API Key
Generate a new API key for SDK usage. This is a public endpoint that doesn't require authentication - perfect for getting started.
Parameters
provider_namestringName of your application or service (default: 'SDK Client')
Request Body
{
"provider_name": "My Application"
}Response
{
"success": true,
"api_key": "f868a9cdc377916bcc33b93b5035f70b180df048b1d041e94d7f157c1464c4e7",
"provider_name": "My Application",
"created_at": "2024-01-15T10:30:00Z"
}{
"success": false,
"error": "Provider name too long (max 100 characters)"
}curl -X POST https://api.brdz.link/api/keys/generate-sdk-key \
-H "Content-Type: application/json" \
-d '{"provider_name": "My Application"}'Create SDK API Key (Authenticated)
Create SDK API Key
Create a new API key for authenticated users. This allows you to manage multiple API keys under your account.
Parameters
provider_namestringName of your application or service (default: 'SDK Client')
Request Body
{
"provider_name": "Production App"
}Response
{
"success": true,
"api_key": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2",
"provider_name": "Production App",
"user_id": 123,
"created_at": "2024-01-15T10:30:00Z"
}{
"success": false,
"error": "Authentication required"
}curl -X POST https://api.brdz.link/api/keys/sdk-key \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY" \
-d '{"provider_name": "Production App"}'List API Keys
List API Keys
Get all API keys associated with your account. Only shows metadata, not the actual key values.
Response
{
"success": true,
"data": [
{
"api_key": "f868a9cdc377...e1f2",
"provider_name": "Production App",
"created_at": "2024-01-15T10:30:00Z",
"last_used": "2024-01-15T15:45:00Z",
"usage_count": 1523
},
{
"api_key": "a1b2c3d4e5f6...d0e1f2",
"provider_name": "Development",
"created_at": "2024-01-10T08:20:00Z",
"last_used": "2024-01-14T12:30:00Z",
"usage_count": 234
}
]
}{
"success": false,
"error": "Authentication required"
}curl -X GET https://api.brdz.link/api/keys/sdk-key \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"Delete API Key
Delete API Key
Permanently delete an API key. This action cannot be undone and will immediately invalidate the key.
Parameters
api_keystringrequiredThe API key to delete (path parameter)
Response
{
"success": true,
"message": "API key deleted successfully",
"deleted_key": "f868a9cdc377...e1f2"
}{
"success": false,
"error": "Authentication required"
}{
"success": false,
"error": "API key not found or not owned by user"
}curl -X DELETE "https://api.brdz.link/api/keys/sdk-key/f868a9cdc377916bcc33b93b5035f70b180df048b1d041e94d7f157c1464c4e7" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "x-api-key: YOUR_API_KEY"API Key Management Best Practices
Security Guidelines
- Store Securely: Never commit API keys to version control
- Environment Variables: Use environment variables for API keys
- Rotate Regularly: Generate new keys periodically and delete old ones
- Monitor Usage: Check API key usage in the dashboard
- Principle of Least Privilege: Use separate keys for different environments
Environment Setup
# .env file
BRDZ_API_KEY=your_api_key_here
BRDZ_JWT_TOKEN=your_jwt_token_here
# React (.env.local)
REACT_APP_BRDZ_API_KEY=your_public_api_key_here
# Node.js
BRDZ_API_KEY=your_api_key_here
Usage in Code
// ✅ Good - Using environment variables
const apiKey = process.env.BRDZ_API_KEY;
const headers = {
'x-api-key': apiKey,
'Content-Type': 'application/json'
};
// ❌ Bad - Hardcoded API key
const headers = {
'x-api-key': 'f868a9cdc377916bcc33b93b5035f70b180df048b1d041e94d7f157c1464c4e7',
'Content-Type': 'application/json'
};
Key Rotation Workflow
- Generate new API key with
/keys/sdk-key - Update applications with new key
- Test that applications work with new key
- Delete old API key with
/keys/sdk-key/{old_key} - Monitor for any failures
For quick setup, use the public /keys/generate-sdk-key endpoint. No authentication required!
- API keys provide access to your BRDZ account
- Never share API keys publicly
- Delete unused API keys immediately
- Monitor API key usage regularly
- Key generation: 5 new keys per hour
- Key listing: 100 requests per minute
- Key deletion: 10 deletions per minute