AI Call

Analytics

API Reference

Интегрируйте аналитику звонков с любым внешним сервисом.

Сгенерируйте API-ключ в Настройках →

Base URL

https://your-domain.com/api/v1

Аутентификация

Передавайте API-ключ в заголовке Authorization каждого запроса:

Authorization: Bearer aca_your_api_key_here

API-ключи начинаются с aca_. Сгенерируйте свой в Настройках.

Быстрый старт

Загрузите аудиофайл, затем опрашивайте до завершения анализа:

# 1. Upload an audio file for analysis (returns 202 immediately)
curl -X POST https://your-domain.com/api/v1/calls \
  -H "Authorization: Bearer aca_your_key_here" \
  -F "file=@/path/to/call.mp3" \
  -F "reportType=medium"

# Response → { "id": "cmp...", "status": "queued", "pollUrl": "/api/v1/calls/cmp..." }

# 2. Poll until status === "completed" or "failed"
curl https://your-domain.com/api/v1/calls/cmp... \
  -H "Authorization: Bearer aca_your_key_here"
// JavaScript — upload and wait for result
async function analyzeCall(filePath, apiKey) {
  const form = new FormData();
  form.append('file', fs.createReadStream(filePath));
  form.append('reportType', 'medium');

  const upload = await fetch('https://your-domain.com/api/v1/calls', {
    method: 'POST',
    headers: { Authorization: `Bearer ${apiKey}` },
    body: form,
  });
  const { id } = await upload.json(); // status: 202

  // Poll every 5 seconds until done
  while (true) {
    await new Promise(r => setTimeout(r, 5000));
    const res = await fetch(`https://your-domain.com/api/v1/calls/${id}`, {
      headers: { Authorization: `Bearer ${apiKey}` },
    });
    const call = await res.json();
    if (call.status === 'completed') return call;
    if (call.status === 'failed')    throw new Error(call.errorMessage);
  }
}

Endpoints

GET/api/v1/me

Возвращает аккаунт, связанный с вашим API-ключом. Полезно для проверки ключа.

POST/api/v1/calls

Загрузите аудиофайл для транскрипции и AI-анализа. Возвращает HTTP 202 сразу с ID звонка. Опрашивайте GET /api/v1/calls/:id пока статус не станет 'completed' или 'failed'. Аудиофайл автоматически удаляется после анализа.

ПараметрТипОписание
fileФайл (multipart)Аудиофайл — MP3, WAV, M4A, OGG, FLAC, AAC, WMA
reportTypestringhigh_level · medium · detailed (по умолчанию: medium)
GET/api/v1/calls

Возвращает список ваших звонков с пагинацией, отсортированный по дате (новые первые).

ПараметрТипОписание
limitintegerКоличество результатов (1–100, по умолчанию 50)
offsetintegerПропустить N записей для пагинации (по умолчанию 0)
statusstringФильтр по статусу: queued · transcribing · analyzing · completed · failed
GET/api/v1/calls/:id

Возвращает полный анализ одного звонка — транскрипцию, оценку, резюме, проблемы, рекомендации и все разделы отчёта.

Пример — ответ GET /api/v1/calls

{
  "calls": [
    {
      "id": "cmpranw3g00049gvmy1r4tgfv",
      "fileName": "call_2024-01-15.mp3",
      "status": "completed",
      "reportType": "medium",
      "language": "uk",
      "product": "CRM Software",
      "saleStatus": "sold",
      "score": 8,
      "createdAt": "2024-01-15T10:30:00.000Z",
      "updatedAt": "2024-01-15T10:31:45.000Z"
    }
  ],
  "total": 42,
  "limit": 50,
  "offset": 0
}

Пример — ответ GET /api/v1/calls/:id

{
  "id": "cmpranw3g00049gvmy1r4tgfv",
  "fileName": "call_2024-01-15.mp3",
  "status": "completed",
  "language": "uk",
  "product": "CRM Software",
  "saleStatus": "sold",
  "score": 8,
  "summary": "Manager successfully presented the product...",
  "customerIntent": "Looking to automate sales tracking",
  "nextStep": "Schedule demo for next week",
  "issues": ["Did not ask about budget", "Interrupted customer twice"],
  "positives": ["Strong product knowledge", "Good rapport"],
  "recommendations": ["Ask discovery questions earlier"],
  "objections": ["Price is too high"],
  "managerMistakes": ["Skipped needs analysis"],
  "detailedReport": [...],
  "transcript": "Manager: Hello...",
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Коды ошибок

HTTP статусОписание
200Успех
202Принято — звонок поставлен в очередь
401Отсутствует или недействительный API-ключ
404Ресурс не найден (или принадлежит другому аккаунту)
500Ошибка сервера — попробуйте снова

Протестируйте

Протестируйте

Отправьте живой запрос прямо из браузера.