Skip to main content

Authentication & Security

The Tournament Platform uses operator API keys with role-based permissions to provide secure, multi-tenant access to tournament functionality.

API Key Authentication

All Casino Integration APIs require authentication via operator API keys passed in the Authorization header:

API Key Format

Tournament Platform uses compound API keys with the following format:
  • Format: pk_xxx:sk_yyy where pk_ is the public key prefix and sk_ is the secret key prefix
  • Example: pk_1234567890abcdef:sk_9876543210fedcba...
  • Usage: The full compound key is used in the Authorization header
  • Security: Keys use SHA256 hashing for authentication validation

Role-Based Permissions

API keys are assigned to operator roles that define specific permissions. This enables fine-grained access control for different use cases.

Available Permissions

Common Role Configurations

All Permissions - For primary integration systems:

API Key Management

Creating API Keys

1

Access Operator Dashboard

Log into your Tournament Platform operator dashboard
2

Navigate to API Keys

Go to Settings → API Keys section
3

Create New Key

Click “Create API Key” and provide:
  • Name: Descriptive name for the key
  • Role: Select appropriate role with required permissions
  • Expiration: Optional expiration date for security
4

Copy Key Secret

Important: Copy the key secret immediately - it won’t be shown again

Key Security Best Practices

Never expose API keys in client-side code, public repositories, or logs. Keys should only be used in secure server-to-server communication.

Storage & Environment

  • Store keys in environment variables or secure credential management systems
  • Use different keys for development, staging, and production environments
  • Rotate keys regularly (recommended: every 90 days)
  • Set expiration dates on keys when possible

Access Control

  • Use least-privilege principle - grant only necessary permissions
  • Create separate keys for different systems or purposes
  • Monitor key usage and disable unused keys
  • Implement IP whitelist restrictions when possible

Example Environment Configuration

Multi-Tenant Security

Operator Isolation

The Tournament Platform provides complete tenant isolation:
  • Data Scoping: All API responses automatically filtered by operator ID
  • Resource Access: No cross-operator access to tournaments or players
  • Configuration Isolation: Independent webhook URLs, settings, and preferences
  • Audit Trails: Separate audit logs per operator

Request Validation

Every API request undergoes:
  1. API Key Validation: Verify key exists and is active
  2. Permission Check: Ensure key has required permissions for operation
  3. Operator Scoping: Filter all data to operator’s resources only
  4. Rate Limiting: Apply per-operator rate limits
  5. Request Logging: Log all API access for audit purposes

Rate Limiting

Standard Limits

Rate Limit Headers

API responses include rate limit information:

Handling Rate Limits

Error Handling

All API endpoints return consistent JSON error responses. The platform no longer returns HTML error pages for validation failures.

Authentication Errors

401 Unauthorized

Common causes:
  • Invalid or expired API key
  • Malformed Authorization header
  • Key not found in system

403 Forbidden

Common causes:
  • API key lacks required permission
  • Attempting to access another operator’s resources
  • Operation not allowed for key’s role

422 Validation Error

Common causes:
  • Missing required fields
  • Invalid data formats
  • Business rule violations

Security Headers

All API responses include security headers:

Testing Authentication

Verify API Key

Expected Response (200 OK):

Check Permissions

Response:

Next Steps

Tournament Management

Start creating and managing tournaments with your authenticated API access.

Player Management

Learn how to register and manage players in your tournaments.