Conversational AI Platform REST API overview

Updated

Save agents, secrets, and phone numbers, and use them to run agent sessions and outbound call campaigns.

Preview documentation

You're reading the Conversational AI Platform (Preview) docs. Switch to Main.

The Conversational AI Platform REST API (Preview) lets you save agents, secrets, and phone numbers in your project, and use them to run agent sessions and outbound call campaigns from your server.

During the Preview, agent sessions run in North America (US). Geofencing isn't supported.

API basics

  • Base URL: https://preview.ai.agora.io/conversational-ai/v1/projects/<appid>, where <appid> is the App ID of your Agora project. Every resource belongs to one project.
  • Authentication: Use token authentication or Basic HTTP authentication for every request.
  • Request: Request and response bodies use JSON. Request URLs and request bodies are case-sensitive.
  • IDs: Each resource returns its ID in a <resource>_id field, such as agent_id, number_id, and campaign_id. Agent, number, and campaign IDs are UUIDs, such as 3f6c2a9e-8d1b-4e7a-9c55-0b2f7d1e4a10. Session IDs are 32 lowercase letters and digits.
  • Timestamps: Timestamps are Unix times in seconds, in fields that end in _ts. Durations have a unit suffix, such as _ms or _seconds. Campaign schedules are the exception: they use local times in the schedule's time zone.

Conventions

The following conventions apply to every endpoint:

  • Pagination: List endpoints return data, has_more, and next_cursor. To get the next page, pass next_cursor in the cursor query parameter. next_cursor is null on the last page.
  • Errors: Every error response contains detail and reason. For all reasons, see Status codes and error reasons.
  • Request ID: Every response includes an Agora-Request-Id header. Include it when you contact Agora support.

REST APIs

The Platform APIs are organized by resource. You save agents, secrets, and phone numbers in your project, then reference them when you start sessions and campaigns.

Agents

An agent is a saved configuration that defines how your agent behaves, including its instructions, variables, greeting, and the models in its pipeline. Use these endpoints to manage agents that you start sessions and campaigns from.

Sessions

A session runs one agent in an RTC channel or a phone call. Use these endpoints to start sessions from a saved or inline agent, control them while they run, and stop them.

Secrets

A secret set stores provider API keys and other credentials, so your agent configurations reference secrets instead of containing them. Secret values are write-only and are never returned.

Phone numbers

A phone number connects your agents to the phone network through your carrier's SIP trunk. Agents call from a registered number, and you can choose the agent that answers inbound calls to it.

Campaigns

A campaign calls a list of contacts with a saved agent, on a schedule or right away. Each call starts a telephony session. Use these endpoints to create campaigns and control them while they run.