Перейти к основному содержимому

API Endpoints

Complete reference for all AICA API endpoints. All paths are relative to the base URL (/api/v1).

Records

Manage call records, upload audio, and access transcripts.

MethodEndpointDescription
GET/recordsList records (paginated, filterable)
GET/records/:idGet record details
POST/records/uploadUpload audio file
POST/records/ingestIngest from webhook (Bitrix24, etc.)
GET/records/:id/transcriptGet transcript
GET/records/:id/audioStream audio file
DELETE/records/:idDelete record

List Records

GET /api/v1/records?page=1&pageSize=20&projectId=proj_abc&status=completed
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx

Query Parameters:

ParameterTypeDescription
pageintegerPage number (default: 1)
pageSizeintegerItems per page (default: 20, max: 100)
projectIdstringFilter by project
statusstringFilter by status: pending, processing, completed, failed
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)
sortstringSort field: createdAt, duration, qualityScore
orderstringSort order: asc, desc

Response:

{
"data": [
{
"id": "rec_a1b2c3d4",
"projectId": "proj_abc123",
"type": "call",
"status": "completed",
"duration": 342,
"qualityScore": 87,
"agentName": "John Smith",
"customerPhone": "+1***4567",
"createdAt": "2026-03-05T10:15:00Z",
"completedAt": "2026-03-05T10:18:42Z"
}
],
"meta": {
"page": 1,
"pageSize": 20,
"total": 285
}
}

Upload Audio

Upload an audio file for processing. Use multipart/form-data.

POST /api/v1/records/upload
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx
Content-Type: multipart/form-data

--boundary
Content-Disposition: form-data; name="file"; filename="call-2026-03-05.wav"
Content-Type: audio/wav

<binary audio data>
--boundary
Content-Disposition: form-data; name="projectId"

proj_abc123
--boundary
Content-Disposition: form-data; name="metadata"
Content-Type: application/json

{"agentName": "John Smith", "customerPhone": "+15551234567"}
--boundary--

Response:

{
"data": {
"id": "rec_x9y8z7w6",
"status": "pending",
"projectId": "proj_abc123",
"createdAt": "2026-03-05T14:30:00Z"
}
}

The record enters the processing pipeline automatically. Use the record.completed webhook or poll GET /records/:id to check progress.

Supported formats: WAV, MP3, OGG, FLAC, M4A. Maximum file size: 500 MB.


Projects

Manage projects and their analysis settings.

MethodEndpointDescription
GET/projectsList projects
POST/projectsCreate project
GET/projects/:idGet project details
PATCH/projects/:idUpdate project
DELETE/projects/:idDelete project
GET/projects/:id/statsProject statistics

Example: Get Project Statistics

GET /api/v1/projects/proj_abc123/stats?from=2026-03-01&to=2026-03-05
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx
{
"data": {
"projectId": "proj_abc123",
"totalRecords": 1250,
"completedRecords": 1198,
"averageQualityScore": 82.4,
"averageDuration": 285,
"period": {
"from": "2026-03-01T00:00:00Z",
"to": "2026-03-05T23:59:59Z"
}
}
}

Analyses

Access analysis results, manage annotations, and perform QA reviews.

MethodEndpointDescription
GET/analysesList analyses
GET/analyses/:idGet analysis details (scores, summary, transcript segments)
POST/analyses/:id/re-analyzeRe-analyze with a different profile
GET/analyses/:id/annotationsList annotations
POST/analyses/:id/annotationsAdd annotation
GET/analyses/:id/reviewGet QA review
POST/analyses/:id/reviewSubmit QA review

Example: Get Analysis

GET /api/v1/analyses/ana_def456
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx
{
"data": {
"id": "ana_def456",
"recordId": "rec_a1b2c3d4",
"qualityScore": 87,
"summary": "Agent handled a billing inquiry professionally. Correctly identified the issue and provided a resolution within SLA.",
"improvements": [
"Could have offered proactive upsell opportunity",
"Closing statement was rushed"
],
"complianceStatus": "passed",
"categories": {
"greeting": 95,
"problemResolution": 88,
"professionalism": 90,
"closing": 72
},
"createdAt": "2026-03-05T10:18:42Z"
}
}

Alerts

Configure alert rules that trigger when records match specified conditions.

MethodEndpointDescription
GET/alertsList alert rules
POST/alertsCreate alert rule
PATCH/alerts/:idUpdate alert rule
DELETE/alerts/:idDelete alert rule

Example: Create Alert

POST /api/v1/alerts
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx
Content-Type: application/json

{
"name": "Low Quality Alert",
"projectId": "proj_abc123",
"condition": {
"field": "qualityScore",
"operator": "lt",
"value": 60
},
"actions": ["webhook", "email"],
"enabled": true
}

Users

Manage users within your organization.

MethodEndpointDescription
GET/usersList organization users
POST/users/inviteInvite user by email
PATCH/users/:idUpdate user role
DELETE/users/:idRemove user from organization

Billing

View usage metrics, credit balances, and manage budget limits.

MethodEndpointDescription
GET/billing/summary/:orgIdUsage summary (current period)
GET/billing/usage/:orgIdDetailed usage metrics
GET/billing/credits/:orgIdCredits list and balances
PATCH/billing/budget/:orgIdUpdate budget limit

Example: Usage Summary

GET /api/v1/billing/summary/org_xxxxx
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx
{
"data": {
"orgId": "org_xxxxx",
"period": "2026-03",
"totalRecords": 450,
"totalMinutes": 3825,
"totalCost": 127.5,
"budgetLimit": 500.0,
"budgetUsedPercent": 25.5,
"credits": {
"available": 372.5,
"used": 127.5
}
}
}

Full-text search across records, transcripts, and analysis results.

MethodEndpointDescription
GET/searchFull-text search

Example

GET /api/v1/search?q=refund+policy&projectId=proj_abc123&limit=10
Authorization: Bearer <token>
X-Selected-Org-ID: org_xxxxx
{
"data": [
{
"recordId": "rec_a1b2c3d4",
"type": "transcript",
"snippet": "...customer asked about the refund policy and the agent explained...",
"score": 0.92,
"createdAt": "2026-03-04T16:22:00Z"
}
],
"meta": {
"total": 34,
"query": "refund policy"
}
}