Skip to main content

Overview

The Analytics & Reporting APIs provide detailed insights and metrics across all TalentG platform features, including lead management performance, telecaller productivity, coupon effectiveness, feedback analytics, and business intelligence.

Base URL

https://talentg.vercel.app/api

Authentication

Analytics endpoints require authentication. Access levels depend on user roles and data sensitivity.
Authorization: Bearer <supabase_jwt_token>
Content-Type: application/json

Telecaller Analytics

Lead Analytics

Personal Telecaller Analytics

Lead Interaction Analytics

Coupon Analytics

Coupon Usage Analytics

Individual Coupon Performance

Feedback Analytics

Feedback Overview

Individual Feedback Item Analytics

Dashboard Analytics

Admin Dashboard Stats

Export Analytics

Export Analytics Data

Error Handling

Common Error Codes

CodeHTTP StatusDescription
UNAUTHORIZED401User not authenticated
FORBIDDEN403Insufficient permissions for analytics access
INVALID_PERIOD400Invalid time period specified
DATA_NOT_FOUND404No analytics data available for the period
EXPORT_FAILED500Failed to generate export file

Error Response Format

{
  "success": false,
  "error": {
    "code": "INVALID_PERIOD",
    "message": "Invalid time period format",
    "details": {
      "supported_formats": ["7d", "30d", "90d", "1y", "custom"],
      "provided": "invalid_period"
    }
  }
}

Rate Limiting

  • Dashboard analytics: 100 requests per hour per user
  • Detailed reports: 50 requests per hour per user
  • Data exports: 10 requests per hour per user
  • Real-time metrics: 1000 requests per hour per user

SDK Examples

const getLeadAnalytics = async (period = '30d') => {
  const token = await getSupabaseToken();

  const response = await fetch(`/api/telecaller/analytics?period=${period}`, {
    headers: {
      'Authorization': `Bearer ${token}`
    }
  });

  const data = await response.json();

  if (data.success) {
    console.log('Conversion rate:', data.data.summary.conversion_rate);
    console.log('Total leads:', data.data.summary.total_leads);
  }

  return data;
};

// Usage
const analytics = await getLeadAnalytics('90d');

Analytics Categories

Telecaller Metrics

  • Lead Management: Creation, contact, qualification, conversion rates
  • Interaction Quality: Call duration, response times, follow-up effectiveness
  • Performance Tracking: Individual and team productivity metrics
  • Source Analysis: Lead source effectiveness and ROI

Business Intelligence

  • Revenue Analytics: Transaction volume, average order value, recurring revenue
  • User Behavior: Signup trends, feature usage, retention rates
  • Conversion Funnels: User journey analysis and drop-off points
  • Geographic Insights: Regional performance and market analysis

Operational Metrics

  • System Performance: API response times, error rates, uptime
  • Support Tickets: Volume, resolution time, satisfaction scores
  • Content Analytics: Popular assessments, completion rates, ratings
Analytics data is updated in real-time and cached for 5 minutes to ensure optimal performance while maintaining data freshness.
Sensitive analytics endpoints require admin-level permissions. Ensure proper access controls are implemented in your application.