API Reference
Overview

API Overview

The OliAI Public API provides programmatic access to contacts, audiences, campaigns, and voice flows. It is designed for integrating OliAI into your own applications and workflows.

Base URLs

EnvironmentBase URL
Productionhttps://api.oliai.in/v1
QA / Staginghttps://api.qa.oliai.in/v1

Authentication

All API requests require an API key passed in the x-api-key header:

x-api-key: sk_live_your_key_here

See Authentication for details on obtaining and managing API keys.

Request Format

  • All request bodies must be JSON with Content-Type: application/json
  • Phone numbers must be in E.164 format (e.g., +919876543210)
  • Dates must be in ISO 8601 format (e.g., 2026-03-15T10:00:00Z)

Response Format

All responses are JSON. Successful responses return 200 or 201. Errors follow this structure:

{
  "statusCode": 400,
  "message": "phoneNumber must be a valid E.164 phone number",
  "error": "Bad Request"
}

Pagination

List endpoints support pagination via query parameters:

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
limitinteger20Items per page (max 100)

Paginated responses include:

{
  "data": [...],
  "total": 150,
  "page": 1,
  "limit": 20,
  "totalPages": 8
}

HTTP Status Codes

CodeMeaning
200OK — request succeeded
201Created — resource created successfully
400Bad Request — validation error, check the message
401Unauthorized — missing or invalid API key
403Forbidden — insufficient permissions
404Not Found — resource does not exist or not in your organization
409Conflict — resource already exists (e.g., duplicate phone number)
429Too Many Requests — rate limit exceeded
500Internal Server Error — contact support

Rate Limiting

The API enforces rate limits per API key:

  • General endpoints: 60 requests/minute
  • Bulk import: 10 requests/minute

When rate limited, the response includes a Retry-After header indicating when you can retry.

Available Resources

ResourceDescription
ContactsManage individual contact records
AudiencesManage contact groups
CampaignsCreate and manage calling campaigns
Voice FlowsList available voice flows
ImportsBulk data import via API