Skip to main content

Welcome to the TopCalls API

A REST API for AI phone agents. Place calls, run campaigns, manage leads and phone numbers, and get each call’s result by webhook.

RESTful Design

Standard HTTP methods and JSON. Works from any language.

Interactive

Send requests from these pages and see the live response.

Webhooks

A notification when each call finishes, with its transcript, summary and outcome.

Well Documented

Schemas, examples and error responses for every endpoint.

Base URL

Authentication

Every request needs your API key in the Authorization header:
Sign in and create a key under Settings > Company, in the API keys section.
Each key carries scopes, one per group of endpoints. Grant only what the key needs. A request outside the key’s scopes returns 403, and detail names the missing scope. New keys don’t include calls:write, campaigns:write or the leads scopes unless you tick them. A read scope never grants writes. The catalog endpoints (/v1/models, /v1/voices, /v1/voices/builtin) need no scope.

API Versioning

The current version is v1, and every path starts with /v1:

Response Format

Responses are JSON. Creating a call returns:
Errors use RFC 7807 Problem+JSON. A validation error lists each bad field:

Quick Start

1. Make Your First Call

2. Check Call Status

3. List Calls

API Endpoints

Calls

Campaigns

Phone Numbers

Leads

Lead Lists

Knowledge Bases

Webhooks

Configuration

Account

Webhooks

TopCalls posts to your server when a call finishes. Set webhook_url on a call for per-call delivery:
Or subscribe the whole account with POST /v1/webhooks, including disposition events such as call.completed.booked_callback. Details are in the Webhooks Guide.

Idempotency

These endpoints accept an optional Idempotency-Key header (8 to 255 characters from [A-Za-z0-9_-]): call create, stop and cancel; campaign create, update, start, pause, resume, stop and test; knowledge base create and update; phone number and carrier create; webhook subscription create and update. Other endpoints ignore it. Only a 2xx response is stored, for 24 hours, and a retry with the same key gets it back with the header Idempotent-Replay: true. Errors aren’t stored, so a retry after one runs again. The body isn’t compared: reuse a key with a different body and you still get the first response. A key reused while the first request is still running gets 409, and a malformed key gets 400.

Rate Limits

Three limits apply, all per account and shared by every key on it:
  • All endpoints: 120 requests per minute unless your account was raised. Every response carries RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. Over it you get 429 with Retry-After and a plain-text body, not Problem+JSON.
  • POST /v1/calls: your account’s max_calls_per_minute (default 20) over a fixed 60-second window. Going over returns 429 with Retry-After: 60 and code: RATE_LIMITED, shown below.
  • Concurrent calls: a call placed while every concurrent-call slot is in use gets 429 with code: concurrency_limit and no Retry-After. Place it again once a call in progress ends.
On a 429 with Retry-After, wait that many seconds and send the same request again. If it keeps coming back, double the wait each time and slow down. Extra keys or servers on the same account don’t raise the ceiling. For steady volume, run a campaign instead of single POST /v1/calls requests, or contact us to raise a limit.

Error Codes

Destinations your account can call

Calls go to mobile, landline, VoIP and business numbers in the countries enabled for your account. Toll-free, pager, personal and high-cost numbers are refused, as are countries not enabled and numbers written with a trunk zero. A refusal returns 422 with code: destination_not_allowed, places no call and holds no credit. A scheduled call is checked when you create it and again when it comes due. To enable a country, contact support.

SDKs & Libraries

There’s no official SDK yet. Any HTTP client works: fetch or axios, Python requests, 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.