Skip to main content

Overview

The Telecaller CRM API provides comprehensive lead management functionality including lead creation, tracking, interaction management, and analytics.

Base URL

https://talentg.vercel.app/api

Authentication

All API endpoints require authentication using Supabase JWT tokens.
Authorization: Bearer <jwt_token>

Lead Management

Create Lead

Get Leads

Update Lead

Interaction Management

Create Interaction

Get Lead Interactions

Analytics & Reporting

Lead Analytics

Telecaller Performance

Error Handling

Error Response Format

All API endpoints return errors in the following format:
{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {
      "field": "specific_field",
      "message": "Field-specific error message"
    }
  }
}

Common Error Codes

CodeHTTP StatusDescription
UNAUTHORIZED401Invalid or missing authentication token
FORBIDDEN403Insufficient permissions for the operation
NOT_FOUND404Lead or resource not found
VALIDATION_ERROR400Invalid input data
RATE_LIMITED429Too many requests
INTERNAL_ERROR500Internal server error

Rate Limiting

API requests are rate limited to prevent abuse:
  • Authenticated users: 1000 requests per hour
  • Unauthenticated requests: 100 requests per hour
  • Bulk operations: 10 requests per minute
Rate limit headers are included in responses:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1640995200

SDK Examples

JavaScript/TypeScript

// Using fetch
const createLead = async (leadData: CreateLeadData) => {
  const response = await fetch('/api/leads', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${token}`
    },
    body: JSON.stringify(leadData)
  })
  
  return response.json()
}

// Using axios
import axios from 'axios'

const api = axios.create({
  baseURL: '/api',
  headers: {
    'Authorization': `Bearer ${token}`
  }
})

const leads = await api.get('/leads', {
  params: { page: 1, limit: 20, status: 'new' }
})

Python

import requests

headers = {
    'Authorization': f'Bearer {token}',
    'Content-Type': 'application/json'
}

# Create lead
response = requests.post(
    'https://talentg.vercel.app/api/leads',
    headers=headers,
    json={
        'name': 'John Doe',
        'email': 'john@example.com',
        'phone': '123-456-7890',
        'company': 'Acme Corp'
    }
)

lead = response.json()

cURL

# Create lead
curl -X POST https://talentg.vercel.app/api/leads \
  -H "Authorization: Bearer your_jwt_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Doe",
    "email": "john@example.com",
    "phone": "123-456-7890",
    "company": "Acme Corp"
  }'

# Get leads
curl -X GET "https://talentg.vercel.app/api/leads?page=1&limit=20" \
  -H "Authorization: Bearer your_jwt_token"