API Reference
API Overview

API Overview

Aila provides a RESTful API for programmatic access to call data, batch uploads, and integrations.

Base URL

https://api.aila.com/v1

Authentication

All API requests require authentication via API keys.

Learn more about Authentication →

Rate Limits

  • Standard Plan: 1000 requests/hour
  • Enterprise Plan: Custom limits

Rate limit headers included in responses:

  • X-RateLimit-Limit
  • X-RateLimit-Remaining
  • X-RateLimit-Reset

API Endpoints

Calls

Get Calls

GET /calls

Query parameters:

  • start_date - Filter by date range
  • end_date - Filter by date range
  • user_id - Filter by team member
  • limit - Results per page (default: 50, max: 100)
  • offset - Pagination offset

Get Single Call

GET /calls/{call_id}

Returns complete call details including transcript, analysis, and quality scores.

Upload Call

POST /calls/upload

Upload a single call recording for processing.

Batch Upload

POST /calls/batch-upload

Upload multiple calls (1-100) in a single request.

Learn more about Batch Upload →

Contacts

List Contacts

GET /contacts

Get Contact

GET /contacts/{contact_id}

Update Contact

PATCH /contacts/{contact_id}

Quality Scores

Get Call Quality

GET /calls/{call_id}/quality

Returns quality checklist results and scores.

Analytics

Team Metrics

GET /analytics/team-metrics

Query parameters:

  • start_date
  • end_date
  • user_ids - Comma-separated list

Webhooks

Subscribe to events and receive HMAC-signed HTTP POSTs when activity happens in Aila. Great for Zapier, Make, n8n, or your own backend.

Available events:

  • call.completed — call finished processing
  • call.data.extracted — structured data pulled from the transcript
  • task.created — auto-task generated from a call
  • task.synced — auto-task pushed to a connected CRM
  • mismo.ready — MISMO 3.4 XML generated (mortgage-lending)
  • test.ping — test delivery

Manage endpoints via POST /organizations/{organizationId}/webhooks.

Learn more about Webhooks →

Response Format

Success Response

{
  "success": true,
  "data": {
    // Response data
  },
  "meta": {
    "page": 1,
    "limit": 50,
    "total": 150
  }
}

Error Response

{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid date format",
    "details": {
      "field": "start_date",
      "expected": "ISO 8601 format"
    }
  }
}

Error Codes

  • 400 - Bad Request (invalid parameters)
  • 401 - Unauthorized (invalid API key)
  • 403 - Forbidden (insufficient permissions)
  • 404 - Not Found
  • 429 - Rate Limit Exceeded
  • 500 - Internal Server Error

Best Practices

Error Handling

Always handle errors gracefully:

try {
  const response = await fetch('https://api.aila.com/v1/calls');
  if (!response.ok) {
    const error = await response.json();
    console.error('API Error:', error);
  }
  const data = await response.json();
} catch (error) {
  console.error('Network Error:', error);
}

Pagination

Use pagination for large datasets:

let offset = 0;
const limit = 100;
let allCalls = [];
 
while (true) {
  const response = await fetch(
    `https://api.aila.com/v1/calls?limit=${limit}&offset=${offset}`
  );
  const data = await response.json();
 
  allCalls = allCalls.concat(data.data);
 
  if (data.data.length < limit) break;
  offset += limit;
}

Rate Limiting

Respect rate limits:

async function makeRequest(url) {
  const response = await fetch(url);
 
  const remaining = response.headers.get('X-RateLimit-Remaining');
  const reset = response.headers.get('X-RateLimit-Reset');
 
  if (remaining === '0') {
    const waitTime = reset - Date.now();
    await new Promise(resolve => setTimeout(resolve, waitTime));
  }
 
  return response.json();
}

SDK Libraries

Official SDKs coming soon:

  • JavaScript/TypeScript
  • Python
  • PHP
  • Ruby

Support

For API support:

  • Review this documentation
  • Check error messages
  • Contact support with:
    • Request details
    • Error response
    • Expected behavior

Next Steps