Skip to main content

BrainPredict Customer API Reference

25 min readLast updated: November 30, 2025

API Reference

Complete API documentation for BrainPredict Customer platform.

Authentication

POST /api/v1/auth/token
Content-Type: application/json

{
  "api_key": "your_api_key",
  "api_secret": "your_api_secret"
}

Response:
{
  "access_token": "eyJ...",
  "token_type": "bearer",
  "expires_in": 3600
}

Ticket Endpoints

# Get ticket with AI insights
GET /api/v1/customer/tickets/{ticket_id}

Response:
{
  "ticket_id": "TKT-12345",
  "subject": "Unable to access premium features",
  "customer_id": "CUST-67890",
  "priority": "high",
  "ai_insights": {
    "escalation_risk": 0.72,
    "predicted_resolution_time": "35 minutes",
    "recommended_agent": "Michael Chen",
    "sentiment": "frustrated",
    "sentiment_score": 0.28
  }
}

AI Model Endpoints

# Get prediction from specific model
POST /api/v1/customer/ai-models/{model_name}/predict
Content-Type: application/json

{
  "ticket_id": "TKT-12345",
  "include_explanation": true
}

Response:
{
  "model": "escalation_predictor",
  "prediction": {
    "escalation_probability": 0.72,
    "confidence": 0.89,
    "risk_factors": [
      "negative_sentiment",
      "long_wait_time",
      "repeat_contact"
    ],
    "recommended_action": "Route to senior agent"
  }
}

Analytics Endpoints

# Get service analytics
GET /api/v1/customer/analytics/overview?period=30d

Response:
{
  "period": "30d",
  "metrics": {
    "total_tickets": 47284,
    "avg_resolution_time": "4.2 hours",
    "csat_score": 94.7,
    "first_contact_resolution": 78.3,
    "escalation_rate": 8.2,
    "self_service_deflection": 42.3
  }
}

Agent Endpoints

# Get agent performance
GET /api/v1/customer/agents/{agent_id}/performance

Response:
{
  "agent_id": "AGT-001",
  "name": "Michael Chen",
  "metrics": {
    "tickets_resolved": 847,
    "avg_resolution_time": "3.2 hours",
    "csat_score": 97.2,
    "first_contact_resolution": 84.5,
    "current_workload": 12,
    "max_workload": 15
  },
  "ai_coaching_tip": "Excellent performance. Consider mentoring junior agents."
}

Webhook Events

# Configure webhook endpoint
POST /api/v1/customer/webhooks
Content-Type: application/json

{
  "url": "https://your-server.com/webhooks/brainpredict",
  "events": [
    "ticket.created",
    "escalation.predicted",
    "sla.breach_risk",
    "churn.detected"
  ],
  "secret": "your_webhook_secret"
}