Skip to main content

Welcome to the TopCalls API

The TopCalls API is a RESTful API that lets you build AI-powered phone agents. Make calls, manage phone numbers, check available models and voices, and integrate with your systems via webhooks.

RESTful Design

Standard HTTP methods and JSON responses. Works with any programming language.

Interactive

Try API endpoints directly in this documentation. See responses in real-time.

Webhooks

Real-time notifications for call events, tool calls, and campaign updates.

Well Documented

Detailed schemas, examples, and error responses for every endpoint.

Base URL

All API requests should be made to:

Authentication

All API requests require authentication. Include your API key in the Authorization header:
Get your API key from topcalls.ai. Sign in and create a new key in your account settings.
API keys carry scopes — each scope grants access to one group of endpoints. When you create a key in the dashboard, grant only the scopes it needs. A request to an endpoint outside the key’s scopes returns 403 Forbidden, and the response names the scope that was missing. A read scope never grants writes: a calls:read key can list calls but cannot place one. The model and voice catalog endpoints (/v1/models, /v1/voices) require no scope — any valid key can read them.

API Versioning

The current API version is v1. All endpoints are prefixed with /v1:

Response Format

All responses are JSON. Success responses include the requested data:
Error responses follow RFC 7807 Problem+JSON format:

Quick Start

1. Make Your First Call

2. Check Call Status

3. List Calls

API Endpoints

Calls

Campaigns

Create, configure, and run campaigns from the API or the TopCalls dashboard:

Phone Numbers

Leads

Lead Lists

Knowledge Bases

Webhooks

Configuration

Account

Webhooks

TopCalls sends webhooks to your server when calls finish. Set webhook_url on a call for per-call delivery:
Or create an account-level subscription with POST /v1/webhooks, including disposition-suffixed events like call.completed.booked_callback. See the Webhooks Guide for complete documentation.

Idempotency

Mutating endpoints accept an optional Idempotency-Key header (8-255 characters, [A-Za-z0-9_-]). The gateway caches the response for 24 hours and returns the same response on retries with the same key. A key reused while the first request is still running returns 409.

Rate Limits

Two limits apply, both counted per account. Every API key on the same account shares them.
  • All endpoints: 120 requests per minute.
  • POST /v1/calls: also limited to your account’s max_calls_per_minute setting (default 20) per minute.
When you go over a limit, the API returns 429 Too Many Requests with a Retry-After header and a Problem+JSON body:
What to do when you get a 429
  1. Read the Retry-After header. Its value is the number of seconds to wait before trying again.
  2. Wait that long, then send the same request again.
  3. If you keep getting 429, you are sending faster than your limit allows. Lower your request rate, or spread the work out over time.
  4. In automated clients, check for status 429 (or the code field equal to RATE_LIMITED) and back off: wait the Retry-After seconds on the first 429, then double the wait on each repeat until the request succeeds.
The limits are per account, so adding more API keys or servers against the same account does not raise the ceiling. For steady high call volume, run a campaign instead of sending individual POST /v1/calls requests, or contact us to raise your max_calls_per_minute.

Error Codes

SDKs & Libraries

Official SDKs coming soon. For now, use any HTTP client library:
  • JavaScript/TypeScript: fetch, axios
  • Python: requests
  • Ruby: httparty
  • Go: net/http
  • PHP: guzzle

Support

Next Steps

Quickstart

Make your first call in 5 minutes.

Making Calls Guide

Learn how to make calls with the API.