Trillet AI logo

Trillet REST API reference

The Trillet REST API reference: the AI phone agent API for agents, call flows, calls, batch calls, phone numbers, knowledge bases, workspaces and integrations.

The Trillet REST API is the AI phone agent API behind the Trillet dashboard. Use it to create agents and call flows, place single and batch calls, buy and configure phone numbers, manage knowledge bases and run message flows. It uses standard HTTP methods and returns JSON.

Base URL

bash https://api.trillet.ai

Authentication

Customer API calls send an API key in x-api-key and the workspace in x-workspace-id. Both headers are required.

curl https://api.trillet.ai/v1/api/workspaces \
  -H "x-api-key: YOUR_API_KEY" \
  -H "x-workspace-id: YOUR_WORKSPACE_ID" \
  -H "Content-Type: application/json"
x-api-keystringrequired

Your API key. Send it in the x-api-key header.

x-workspace-idstringrequired

Workspace the request applies to.

Content-Typestring

Set to application/json when you send a JSON body. Leave it off requests with no body, such as DELETE: an empty body sent as application/json is rejected with 400.

An API key acts as the user who created it, with that user's role, in any workspace the user belongs to. x-workspace-id picks the workspace. See Authentication.

Authorization: Bearer carries dashboard session tokens and connected-app (OAuth) tokens. Voice Engine partner keys (tpk_...) also use Authorization: Bearer. Your API key belongs in x-api-key.

Get your API key from Trillet Settings Dashboard

API Resources

Call Agents API

Create and manage conversational call agents with unique voices and personalities through our REST API

Call Flows API

Design and control call & conversation flows programmatically

Message Flows API

Design and control call & conversation flows programmatically

Voice Calls API

Initiate and manage voice calls via REST endpoints

Conversations API

Design and control customer interactions through conversations programmatically

Knowledge Bases API

Create knowledge bases and add text or files

Voices API

Search the public voice catalog and manage workspace voices

Rate Limits

There is no general per-plan request quota. Two kinds of limit do apply:

  • Outbound calls are limited per workspace, per minute:

    WorkspaceSingle callsBatch calls
    No paid plan and no top-up1 / min1 / min
    Studio, Agency Plus, or after a top-up20 / min40 / min
    EnterpriseNo limitNo limit

    Going over the limit returns an error with a message telling you how many seconds to wait. Wait that long before the next call.

  • A few endpoints, such as voice previews and the public web call endpoints, have their own limits and answer 429 Too many requests when you exceed them.

Back off and retry in both cases. If you expect sustained high volume, talk to the Trillet team first.

Error Handling

The API uses conventional HTTP status codes:

CodeMeaning
200Success
201Created (for example, a new folder or role)
400Bad request: a missing or invalid field, a missing x-workspace-id (Workspace ID is required.), a malformed x-workspace-id (Invalid workspace ID), or an empty wallet when placing a call (INSUFFICIENT_FUNDS)
401Missing, invalid or expired credentials
402Payment required: the subscription is unpaid or the trial has ended, a spend cap has been reached, or creating a workspace needs payment for your plan
403Forbidden: your role lacks the permission, or the key's user is not a member of the workspace in x-workspace-id
404Not found
409Conflict, for example a call placed outside the call flow's calling hours (OUTSIDE_CALLING_HOURS)
422The request is valid but can't be carried out, for example placing a call with an agent that has no live call flow (NO_ACTIVE_CALL_FLOW, CALL_FLOW_INBOUND_ONLY)
423Locked: another workspace create or restore for your account is still in progress. Retry shortly
429Too many requests on a rate-limited endpoint
500Server error

Error bodies are flat JSON objects. error is a short string. Many responses add a human-readable message, and some add a machine-readable code:

{
  "error": "Workspace ID is required."
}
{
  "error": "Insufficient funds",
  "code": "INSUFFICIENT_FUNDS",
  "message": "Your workspace balance is $0.00. Please add funds to continue.",
  "balance": 0,
  "walletScope": "workspace"
}

A few endpoints use a different shape. Initiate Call returns {"status": "error", "message": "...", "code": "INVALID_PHONE_NUMBER"}, and the folder endpoints return only {"message": "..."}. Read code when it is present and fall back to message or error; don't parse the text.

Need Help?

API Status [Coming Soon!]

Check our API status and uptime

Support

Get technical support

Last updated on