页面简介
Build, run, and observe PolyAI agents from your own systems. Three API families, one platform, 99.994% uptime in production.
正文摘录
PolyAI Platform · API ReferenceBuild voice agents from code.Three REST API families cover the full lifecycle — ship agents, run conversations, and observe everything in production. No SDK required.Quickstart →Browse APIsError codes The three API families Pick the family that matches your job. Each has its own base URL, key, and audience. Build & deployAgents APIProgrammatically create agents, edit behavior and knowledge, branch, and ship through environments.api..poly.aiRuntime & dataConversations, Chat, Handoff…Interact with running agents and read post-call data. Transcripts, audio, metrics, sessions.api.-1.platform.polyai.appMonitoringAlerts & WebhooksReceive real-time events when calls complete, alerts fire, or handoffs happen. Stop polling.api..poly.ai I want to… Task-oriented entry points. Jump straight to a working example. Build an agent from the APIFull walkthrough: create → branch and configure → merge to Sandbox → test → promote to live.Pull conversation dataQuery transcripts, metrics, and audio for analytics and compliance pipelines.Build & deploy an agentCreate agents, edit behavior and knowledge, promote sandbox → pre-release → live.Get notified on eventsRegister a webhook endpoint and receive signed POSTs on conversation and handoff events.Send a chat messageDrive a text-based conversation programmatically with create, respond, close.Trigger an outbound callPlace a programmatic outbound call to a target number and track its status. Pick your region Your key is provisioned to a region. The host differs by API family — the platform.polyai.app host carries a -1 suffix, the poly.ai host doesn’t. Do not use https://api.poly.ai without a region prefix — it returns an error. Always include the region. Finding your account_id and project_id Your account_id and project_id are the first two path segments of your Dialog Studio URL: https://studio.<region>.poly.ai/<account_id>/<project_id>/... Dialog Studio is region-specific. Each Studio host serves one region and is paired with the matching API host. Replace <region> with the subdomain for your tenant:Studio URLAPI hosthttps://studio.us.poly.aihttps://api.us-1.platform.polyai.apphttps://studio.uk.poly.aihttps://api.uk-1.platform.polyai.apphttps://studio.eu.poly.aihttps://api.euw-1.platform.polyai.apphttps://studio.poly.aihttps://api.studio.poly.ai (self-serve / Studio region)A workspace lives in exactly one region — use the Studio host you log in to, and the matching API host for calls. For example, if your Studio URL is https://studio.uk.poly.ai/acme-uk/acme-team-4/agent, then account_id is acme-uk and project_id is acme-team-4. Both the slug form (visible in the URL) and the prefixed form are accepted in API paths: Path parameterSlug form (from URL)Prefixed formaccount_idacme-ukws-xxxxxxxxproject_idacme-team-4PROJECT-xxxxxxxx The account_id path parameter corresponds to the workspace in Dialog Studio. Its prefixed form starts with ws- (for example ws-fd112d8f) — not ACCOUNT-. Older docs may still refer to the prefixed form as ACCOUNT-xxxxxxx; the value you see in Dialog Studio (prefixed with ws-) is the correct one to use. Authenticate Every PolyAI API uses an API key sent in the x-api-key header. Create keys from the API Keys tab in Dialog Studio (see API keys) — runtime and build keys are separate. curlPythonTypeScriptcurl -X GET \ "https://api.<region>.platform.polyai.app/v3/ws-xxxxxxxx/PROJECT-xxx/conversations" \ -H "x-api-key: YOUR_API_KEY" Key hygiene. Treat keys as secrets. Never commit or embed in client-side code. If a key leaks, contact PolyAI to rotate immediately. Agents API vs. Conversations API These two get confused most often. Use this table to pick the right one. Agents APIConversations APIPurposeBuild and deploy agentsRead call data and transcriptsDirectionWrite (create, update, deploy)Read (query, retrieve)Base URLapi.{region}.poly.ai/v1/agents/…api.{region}.platform.polyai.app/v3/…AuthAPI key (workspace-scoped)API key (project-scoped)Who uses itDevelopers automating agent buildsAnalysts, integrations pulling call data In short: Agents API creates and ships agents. Conversations API tells you what those agents did on calls. Versioning Only the Conversations API is versioned today. Everything else is unversioned. RecommendedEvent-sourced, scalable, full schema with latency and translation fields. Use for all new integrations.Same schema as v3, legacy auth model. Continue if already integrated.SunsettingBest-effort from 2 Mar 2026 · unsupported from 31 Aug 2026. Migrate to v3. Browse the catalog Every endpoint, grouped by API. AgentsConversationsChatDebug ChatDialog-RSN-1HandoffOutbound callingConcurrent callsDNIExternal eventsMessagingWebRTC BridgeAlertsWebhooksError codes Need a hand getting started?Walk through building an agent end-to-end, from your first API key to a live deployment.Start the quickstart →Last modified on December 2, 2026Was this page helpful?YesNo⌘I