Authentication
SAPIENTRIS API uses API key authentication to secure access to the platform. All API requests must include a valid API key.
API Key Types
Personal API Keys
Personal API keys are tied to your user account and inherit your permissions. These are ideal for:
- Development and testing
- Personal projects
- Small-scale integrations
Tenant API Keys
Tenant API keys provide broader access and are designed for:
- Production applications
- Team collaboration
- Enterprise integrations
Getting Your API Key
- Log in to your SAPIENTRIS account
- Navigate to Dashboard → API Keys
- Click Create New API Key
- Provide a descriptive name for your key
- Select appropriate permissions
- Copy and securely store your API key
⚠️ Important: API keys are only shown once. Store them securely and never commit them to version control.
Using API Keys
Include your API key in the request headers:
curl -H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
https://api.sapientris.com/v1/casinos
Headers Required
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Accept: application/json
API Key Management
Revoking Keys
You can revoke API keys at any time from your dashboard. Revoked keys immediately lose access to all API endpoints.
Key Rotation
For security best practices:
- Rotate API keys regularly (recommended: every 90 days)
- Use different keys for different environments
- Monitor key usage in your dashboard
Permissions
API keys can have different permission levels:
- Read Only: Access to GET endpoints only
- Read/Write: Access to GET, POST, PUT endpoints
- Admin: Full access including DELETE operations
- Custom: Specific endpoint permissions
Error Responses
401 Unauthorized
{
"error": "Invalid API key",
"message": "The provided API key is invalid or has been revoked"
}
403 Forbidden
{
"error": "Insufficient permissions",
"message": "Your API key does not have permission to access this resource"
}
Security Best Practices
- Never expose API keys in client-side code
- Use HTTPS only for all API calls
- Store keys securely using environment variables
- Monitor usage regularly for unusual activity
- Rotate keys on a regular schedule
- Use least privilege principle for permissions
Third-Party API Integration
SAPIENTRIS also supports integrating your own third-party API keys for enhanced functionality:
- OpenAI: For AI-powered content generation
- Anthropic: For advanced language processing
- Twitch API: For streamer data enrichment
- Google APIs: For analytics and trends
Configure these in Settings → Third-Party APIs to unlock additional features.