Complete REST API reference for SafeBet IQ Connect integration
Authentication and base configuration
https://api.safeplay.ai/v1All requests require a Bearer token in the Authorization header:
Authorization: Bearer sk_prod_your_api_key_here
Submit real-time player activity data
{
"player_id": "PLR-9381",
"session_id": "SES-2024-001",
"timestamp": "2024-11-25T14:30:00Z",
"game_type": "blackjack",
"bet_amount": 1100,
"win_amount": 0,
"session_duration_minutes": 120,
"total_wagered": 45000,
"total_wins": 18000,
"total_losses": 27000,
"bet_frequency": 8.5,
"player_metadata": {
"email": "player@example.com",
"phone": "+27821234567",
"join_date": "2024-01-15"
}
}{
"success": true,
"player_id": "PLR-9381",
"risk_score": 87,
"risk_level": "high",
"recommendation": "intervention_suggested",
"triggers": [
"extended_session_duration",
"increasing_bet_pattern",
"loss_chasing_behavior"
],
"intervention": {
"required": true,
"type": "immediate",
"channels": ["whatsapp", "email"],
"message_template": "high_risk_alert"
}
}Sync multiple players at once (up to 100 per request)
{
"players": [
{
"player_id": "PLR-9381",
"session_duration_minutes": 120,
"bet_amount": 1100,
"total_wagered": 45000
},
{
"player_id": "PLR-9382",
"session_duration_minutes": 45,
"bet_amount": 250,
"total_wagered": 8500
}
]
}{
"success": true,
"processed": 2,
"results": [
{
"player_id": "PLR-9381",
"risk_score": 87,
"risk_level": "high"
},
{
"player_id": "PLR-9382",
"risk_score": 34,
"risk_level": "low"
}
]
}Retrieve current risk assessment for a player
GET /players/PLR-9381/risk{
"player_id": "PLR-9381",
"risk_score": 87,
"risk_level": "high",
"last_updated": "2024-11-25T14:32:15Z",
"session_metrics": {
"duration_minutes": 120,
"total_wagered": 45000,
"win_loss_ratio": 0.67
},
"historical_trend": "increasing",
"interventions_sent": 2
}Receive real-time notifications when risk thresholds are exceeded
Set up your webhook URL in the Casino Dashboard Settings. SafePlay will POST to your endpoint when:
{
"event_type": "risk_threshold_exceeded",
"timestamp": "2024-11-25T14:35:00Z",
"player_id": "PLR-9381",
"risk_score": 92,
"risk_level": "critical",
"triggers": ["rapid_loss_increase", "extended_session"],
"recommended_action": "immediate_intervention"
}200Success400Bad Request - Invalid parameters401Unauthorized - Invalid API key429Too Many Requests - Rate limit exceeded500Server Error - Contact support