# Trillet AI - Complete Documentation
> This file contains the complete documentation for Trillet AI.
> Total pages: 189
---
## Voice AI MCP server for Claude, ChatGPT and Cursor
*Trillet's voice AI MCP server for Claude, ChatGPT and Cursor: build, test and run AI phone agents from your AI assistant or any other MCP client.*
Trillet runs an official voice AI MCP server for Claude, ChatGPT, Cursor and other [Model Context Protocol](https://modelcontextprotocol.io) (MCP) clients. Connect it to your AI assistant and you can manage your Trillet account by describing what you want in plain language. The assistant reads your setup, makes the changes, and tells you what it did.
The hosted server lives at:
```
https://mcp.trillet.ai/mcp
```
## What you can do
Create agents and call flows, write prompts, pick voices, set the welcome message, speech settings, transfers, office hours, and post-call analysis.
Chat with your agent as if you were a caller. The assistant plays the caller turn by turn and reports how the agent handled it.
Read call history and transcripts, get a digest of what went wrong, and fix the prompt from what callers actually said.
Search, buy, and assign phone numbers, manage knowledge bases and workflows, check usage, and design your website widget and demo pages.
ChatGPT gets a smaller set of tools than the other clients: building agents, call flows, call-flow settings, knowledge bases from text, and demo links. It can't read call history or transcripts, run text test calls, place calls, manage phone numbers or workflows, or delete anything. See [What ChatGPT can do](/mcp/chatgpt#what-chatgpt-can-do).
See [What you can ask](/mcp/example-prompts) for example prompts, [Prompts and resources](/mcp/prompts-and-resources) for ready-made tasks like testing an agent or reviewing a week of calls, and the [tool reference](/mcp/tools/index) for every tool and its parameters.
## Choose how to connect
| You use | Connect with | Sign-in | Guide |
|---|---|---|---|
| ChatGPT | Custom MCP connector at `https://mcp.trillet.ai/mcp` | Log in to Trillet | [Connect ChatGPT](/mcp/chatgpt) |
| Claude.ai or Claude Desktop | Custom connector at `https://mcp.trillet.ai/mcp` | Log in to Trillet | [Connect Claude](/mcp/claude) |
| Claude Code | `claude mcp add` with an API key | API key | [Claude Code and other clients](/mcp/claude-code-and-other-clients) |
| Cursor or another MCP client | Hosted server with an API key, or the `@trillet-ai/mcp` npm package | API key | [Claude Code and other clients](/mcp/claude-code-and-other-clients) |
If you use ChatGPT or Claude, use the connector. You sign in with your Trillet login and there is no API key to copy.
## How the connection works
When you connect ChatGPT or Claude, you log in to Trillet and approve access on a consent screen. The connection then acts as you:
- It can work in **every workspace you belong to**. You pick the workspace it starts in, and you can switch at any time by asking.
- It can only do what your Trillet account can do. Trillet checks your workspace membership on every request.
- It can't change your password or email, and it can't see or create API keys.
Read [Security and permissions](/mcp/security) for the full picture, including how to disconnect.
## Work across workspaces
Agencies and teams with several workspaces can move between them in the same conversation. Refer to a workspace by name:
- "List my workspaces."
- "Switch to Acme Clinic."
- "List the agents in Bondi Dental."
The assistant uses `trillet_list_workspaces` and `trillet_switch_workspace` for this. Every tool also accepts a workspace name or id for a single request, so "show yesterday's calls in Harbour Dental" works without switching.
Actions taken through the assistant are real. Outbound calls, text test calls, phone number purchases, and workflow runs happen for real and are billed to your workspace wallet. Outbound calls, number purchases, and workflow runs need an explicit confirmation before they run. Text test calls don't. See [Security and permissions](/mcp/security#actions-that-are-real-and-billed).
## Next steps
Add Trillet as a custom connector in ChatGPT.
Add Trillet as a custom connector in Claude.ai and Claude Desktop.
Example prompts for building, testing, and reviewing agents.
Fixes for the most common connection and tool errors.
---
## API best practices: keys, errors and rate limits
*API best practices for the Trillet REST API: keep API keys secure, handle errors and retries, stay within the outbound call limits, and check your setup before production.*
These API best practices cover how to call the Trillet REST API safely and reliably: keeping API keys secure, handling errors, staying within rate limits and checking your integration before you go to production.
## Authentication
### API Keys
- Keep your API keys secure and never expose them in client-side code
- An API key acts as the user who created it, with that user's role, in every workspace that user belongs to. Create keys from a dedicated user whose role has only the permissions your integration needs
- Use different API keys for development and production
- Rotate your API keys periodically
- Send the key in the `x-api-key` header, with the workspace in `x-workspace-id`
## Error Handling
Errors come back as flat JSON objects, not a nested `error` object. Check the HTTP status first, then read `code` when it is present, and fall back to `message` or `error`. Don't parse the text. See [API introduction](/v1/api-reference/introduction) for the status codes.
```bash
curl -X POST https://api.trillet.ai/v1/api/call \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"call_agent_id": "a5a5a5a5a5a5a5a5a5a5a5a5",
"to": "+14155550123"
}'
```
An empty wallet (`400`):
```json
{
"error": "Insufficient funds",
"code": "INSUFFICIENT_FUNDS",
"message": "Your workspace balance is $0.00. Please add funds to continue.",
"balance": 0,
"walletScope": "workspace"
}
```
An invalid phone number (`400`):
```json
{
"status": "error",
"message": "to must be a valid phone number in E.164 format, e.g. +14155550123",
"code": "INVALID_PHONE_NUMBER"
}
```
An agent with no live call flow (`422`):
```json
{
"status": "error",
"message": "Failed to initiate call",
"error": "This agent has no live call flow, so the call can't run. Use an agent whose call flow is live, or create one in the portal.",
"code": "NO_ACTIVE_CALL_FLOW"
}
```
[Initiate Outbound Call](/v1/api-reference/endpoints/calls/initiate-call) lists every code that endpoint returns.
## Rate Limits
There is no general per-key request quota. What is enforced:
- **Outbound calls** ([Initiate Outbound Call](/v1/api-reference/endpoints/calls/initiate-call)) are limited per workspace in a 60-second window: 1 call per minute without a paid plan or wallet top-up, 20 per minute on Studio or Agency Plus or after a top-up, and no limit on Enterprise pricing. Calls placed by a batch use a separate allowance. Over the limit, the call is rejected with `error` "Rate limit exceeded: ... Please wait S seconds before making another call." Wait that many seconds before retrying.
- **A few other endpoints**, such as voice previews and the public web call endpoints, have their own limits and answer `429` when you exceed them.
Retry with backoff on `429` and on `5xx` responses. Don't retry `4xx` responses unchanged: fix the request first.
## Production Checklist
1. **Authentication**
- Use production API keys from a dedicated, least-privilege user
- Implement key rotation
- Secure key storage
2. **Error Handling**
- Branch on HTTP status and `code`, not on message text
- Retry with backoff on `429` and `5xx`, and honour the wait in the outbound call rate-limit message
- Log errors appropriately
3. **Monitoring**
- Track API response times
- Monitor error rates
- Set up alerts
## Need Help?
Check our API status and uptime
Get technical support
---
## Inbound call webhook: pass caller data to your agent
*Use the inbound call webhook to look up the caller before your AI agent answers and pass details such as their name or order status into the prompt.*
The inbound call webhook lets your system look up the caller before your AI agent answers. When a call comes in, Trillet sends a `GET` request to your URL with the caller's phone number, and the `variables` your endpoint returns are filled into the agent's prompt and welcome message. In the call flow editor it is the **Pre-call webhook**, under **Settings > Advanced Settings > Data & Events > Webhooks**. Web calls to the same call flow use it too.
## How the request is sent
- The method is `GET`, with the headers and query parameters you configure.
- The caller's number is sent as the `phone_number` query parameter. To put it somewhere else, use the `{{_system.phoneNumber}}` placeholder in the URL, a header or a parameter. Phone number metadata tags are available as `{{_metadata.your_key}}`.
- Your endpoint must respond with HTTP 200 within 10 seconds. If it fails or times out, the call goes ahead without the variables.
## Prerequisites
Before you begin, make sure you have:
- An account for your application.
- A valid URL to handle webhook calls.
## Configure Webhook Settings
To get started, open your call flow, go to **Settings > Advanced Settings > Data & Events > Webhooks**, expand **Pre-call webhook**, and set up your webhook URL, headers, and query parameters. Publish the call flow afterwards: live calls use the published version.
- Enter your webhook URL
- Add your API authentication details, such as bearer tokens or API keys.
- Include any dynamic parameters you wish to pass, such as customer_name and order_status.

## Create an API Receiver
- Create an API endpoint to process incoming webhook requests.
```bash
app.get('/get-webhook', (req, res) => {
console.log("Request Headers: ", req.headers);
console.log("Request Query: ", req.query);
// Respond with variables for AI prompt
res.status(200).json({
variables: {
customer_name: "John Doe",
order_status: "shipped"
}
});
});
```
Note: The API response should always include the variables object in the following format:
```bash
{
"variables": {
"customer_name": "John Doe",
"order_status": "shipped"
}
}
```
## Replace Variable in AI Prompts
Use the returned variables from your webhook to dynamically update AI prompts.
Example Prompt in Call Flow Designer:
```bash
Hello, {{customer_name}}, your order status is {{order_status}}.
```
When the webhook processes the request, variables are replaced dynamically:
```bash
Hello, John Doe, your order status is shipped.
```
---
## Trillet voice AI API and platform overview
*Trillet is a voice AI API and platform for AI phone agents, phone numbers, outbound calls and workflows, with MCP for AI assistants, white-label and OEM.*
Trillet is a voice AI API and platform for building AI phone agents that answer and place calls, chat on your website and hand off to people when needed. You can build agents in the dashboard, with the REST API, or from an AI assistant over MCP, then connect phone numbers, run batch outbound calls and automate follow-up with workflows. Calls start from $0.12 per minute and phone numbers from $4.99 per month.
**For AI agents and LLMs.** A full index of these docs is at [/llms.txt](https://docs.trillet.ai/llms.txt) and the complete text is at [/llms-full.txt](https://docs.trillet.ai/llms-full.txt). Add `.md` to any page URL to get its Markdown source. The Trillet OEM OpenAPI spec is at [trillet-oem.json](https://raw.githubusercontent.com/TrilletAI/trillet-ai-docs/main/public/openapi/trillet-oem.json).
## Start building
Set up your first agent in minutes!
Explore our comprehensive API documentation
## Other ways to build
Build and test agents from Claude, ChatGPT, Cursor and other MCP clients
Run Trillet voice agents inside your own product for each of your customers
## Core Features
Create and manage conversational call agents with unique voices and personalities through our REST API
Create knowledge bases and add text or files
Design and control call & conversation flows programmatically
Create SMS and chat flows and switch autopilot on or off
Initiate and manage voice calls via REST endpoints
Design and control customer interactions through conversations programmatically
## Getting Started
1. Sign up for an API key at [app.trillet.ai](https://app.trillet.ai)
2. Follow our [Quick Start Guide](/documentation/quickstart) to make your first API call
3. Explore our [API Reference](/v1/api-reference/introduction) for detailed endpoint documentation
## Resources
Complete API reference
API integration guidelines
Get technical help
---
## On-Premise Deployment
## On-Premise Deployment: Run Trillet in Your Own Infrastructure
Trillet is now available for on-premise deployment. For enterprises that need complete control over where their data lives, you can run our full voice AI platform within your own infrastructure.
**Trillet is the only voice AI orchestration and application platform in Australia offering on-premise deployment.**
## Why On-Premise?
### Data Sovereignty
Customer conversations never leave your controlled environment. For Australian companies operating under strict regulatory requirements, this simplifies compliance and gives your security team full visibility over where sensitive data resides.
### Privacy
Voice interactions contain highly personal information. On-premise deployment ensures that customer calls, account details, and sensitive data stay within your perimeter, not traversing third-party networks.
### Compliance
Whether you're navigating APRA CPS 234, HIPAA, or internal security policies, on-premise deployment provides the audit trail and control you need to satisfy regulators and stakeholders.
### Performance
Running locally eliminates network latency to external providers, delivering faster response times for your customers.
## What's Included
Trillet ships as a Docker container that includes our complete platform: the orchestration layer, API management, and management UI. You're not just getting an inference engine, you're getting the full application.
**Bring your own providers.** Trillet orchestrates your choice of TTS, LLM, and telephony components, including on-premise models from providers that offer them. You control the stack.
## Who It's For
On-premise deployment is designed for Australian enterprises with strict data sovereignty requirements. If your security policies require that customer voice data stays within infrastructure you control, or if you operate in regulated industries where compliance demands are high, on-premise is for you.
## Still Fully Managed
On-premise doesn't mean DIY. Our team handles deployment, configuration, updates, and ongoing support. You get the compliance posture of on-premise with the operational simplicity of a managed service.
## Get Started
To discuss on-premise deployment for your organisation, [contact our sales team](https://cal.com/forms/1feb42e7-a4b2-4cd3-8076-18ea016b1a2f).
---
## Platform integrations
*Platform integrations for Trillet: trigger outbound AI calls from automation tools with custom nodes, and embed voice agents in your web app with the Web SDK.*
## Trillet AI Integrations
Trillet AI offers seamless integration with popular automation tools like **Make.com**, **n8n**, and our **Web SDK**, allowing you to automate **outbound AI voice calls** and embed **AI agents directly into your applications**. Use these platforms and tools to trigger TrilletAI's call capabilities directly from your workflows or integrate voice agents into your websites.
Looking to connect a business app to a call flow so your agent can book work during a call? See [ServiceM8](/documentation/integrations/servicem8).
---
## Make.com Integration
Integrate Trillet AI with Make.com **custom node** to automate **outbound voice call workflows**. This is ideal for building call-based campaigns, customer notifications, or voice follow-ups powered by Trillet AI.
### Installation
To add TrilletAI's app to your Make.com organization:
You can find TrilletAI directly on Make.com by searching **"TrilletAI"** in the App list under the `us1` or `us2` regions.
If TrilletAI does not appear in your region or account, use the invitation link below to add it manually:
🔗 **[Click here to install](https://www.make.com/en/hq/app-invitation/380f3212527664bd958eb3bf383c97fe)** if it doesn't appear.
## n8n Integration
TrilletAI provides a **custom node** for [n8n](https://n8n.io) to let you trigger **outbound voice calls** directly within your workflows. This allows you to automate call-based sequences based on custom events, user actions, or external system triggers.
### Installation Steps
1. Ensure `n8n` is installed on your machine. If not, follow [n8n installation guide](https://docs.n8n.io/).
2. Open your terminal and install the TrilletAI node package:
```bash
npm install n8n-trillet-nodes
```
---
## SDK Integration
The Trillet AI Web SDK allows you to integrate **AI-powered voice agents** directly into your website or web application. This enables users to interact with your Trillet AI agents via voice or text calls, ideal for embedding real-time AI conversations in client-facing apps, demos, or custom workflows. The SDK handles real-time audio and supports features like transcription, audio analysis, and event emitting.
### Installation
You can install the SDK via npm for modern web frameworks (e.g., React, Next.js) or load it directly from a CDN for simple HTML integrations.
#### Via npm
1. Install the package:
```bash
npm install @trillet-ai/web-sdk
```
2. Import and use in your code:
```typescript
import { TrilletAgent } from '@trillet-ai/web-sdk';
```
#### Via CDN (No Build Tools Required)
Include the SDK script in your HTML. Pin a version in the URL so a future release can't change your page without you knowing:
```html
```
**Note:** The SDK requires a browser environment with secure context (HTTPS or localhost). It does not support server-side rendering.
### Configuration
Initialize a `TrilletAgent` instance:
```typescript
const agent = new TrilletAgent({
workspaceId: 'your-workspace-id',
agentId: 'your-agent-id',
variables: { key: 'value' },
mode: 'voice',
});
```
### Usage
1. **Start a Call:**
- Use `startPublicCall()` in the browser. It needs only `workspaceId` and `agentId`, and the call flow must have **Public Access** on (see the note below).
- `startCall()` sends your API key with the request, so it is **server-side only**. Never call it from browser code: anyone could copy the key from the page.
```typescript
try {
await agent.startPublicCall();
console.log('Call started');
} catch (error) {
console.error('Failed to start call:', error);
}
```
**Using an API key without exposing it.** If you don't want to turn on Public Access, start the call on your own server with `createCall` from `@trillet-ai/web-sdk/server`, send the result to the browser, and join it there with `joinRoom()`. The browser never sees your API key.
```typescript
// On your server (Node.js)
import { createCall } from '@trillet-ai/web-sdk/server';
const roomDetails = await createCall({
apiKey: process.env.TRILLET_API_KEY,
agentId: 'your-agent-id',
mode: 'voice',
});
// Return roomDetails to your frontend
```
```typescript
// In the browser
const agent = new TrilletAgent({ agentId: 'your-agent-id', mode: 'voice' });
await agent.joinRoom(roomDetails);
```
2. **End a Call:**
```typescript
agent.endCall();
```
3. **Toggle Microphone:**
```typescript
agent.toggleMicrophone(true); // Enable microphone
```
4. **Event Handling:**
The SDK extends `EventEmitter`. Listen for events like `connected`, `disconnected`, `error`, `assistantStartedSpeaking`, etc.
```typescript
agent.on('connected', (details) => {
// details: { callId, roomName, display: { agent_name, call_flow_name, workspace_name } }
console.log('Connected:', details.callId, details.display?.agent_name);
});
agent.on('disconnected', () => {
console.log('Call ended');
});
agent.on('error', (error) => {
console.error('Error:', error);
});
```
5. **Transcripts:**
Access real-time and final transcripts:
```typescript
const transcripts = agent.getTranscripts(); // Array of Transcript objects
const current = agent.getCurrentTranscript(); // Partial transcripts
```
### SDK Integration Preview
**Important:** `startPublicCall()` only works when the call flow has **Public Access** turned on and that change is published. The quickest way: open the call flow, click **Website widget** in the header, then **Get embed code**, and use **Turn on Public Access** and **Publish changes** in that dialog. The same switch is also under **Settings > Advanced Settings > Security & Privacy > HIPAA & Compliance**. Without it the call is refused with 403 `Public access not allowed for this agent`.
### Examples
#### React Component Integration
For React/Next.js apps, create a basic component to handle calls:
```tsx
import { useState, useRef } from 'react';
import { TrilletAgent } from '@trillet-ai/web-sdk';
const VoiceAgent = ({ agentId, workspaceId }) => {
const agentRef = useRef(null);
const [isCallActive, setIsCallActive] = useState(false);
if (!agentRef.current) {
agentRef.current = new TrilletAgent({
workspaceId,
agentId,
});
}
const startCall = async () => {
try {
await agentRef.current.startPublicCall();
setIsCallActive(true);
} catch (error) {
console.error('Failed to start call:', error);
}
};
const endCall = () => {
agentRef.current.endCall();
setIsCallActive(false);
};
return (
);
};
export default VoiceAgent;
```
#### Simple HTML Button Integration
Embed a button that starts/stops a voice call with your agent:
```html
```
**Note:** Replace placeholders like `your-workspace-id` and `your-agent-id` with your actual Trillet AI credentials. For production, secure sensitive data (e.g., avoid exposing API keys client-side). The SDK handles browser compatibility checks internally. If you encounter issues, ensure microphone permissions are granted and test in a secure context.
---
## Build your first AI phone agent (dashboard)
*Build your first AI phone agent in the Trillet dashboard: create a call flow, write the prompt, test it, assign a phone number, place calls and add transfers.*
This guide walks you through building your first AI phone agent in the Trillet dashboard. You will create a call flow, write and test the prompt, assign a phone number, place single and batch calls, and set up transfers to your team. If you would rather build with code, see the [REST API reference](/v1/api-reference/introduction) or [build from an AI assistant over MCP](/mcp).
## Getting Started
Once you sign in, you'll land on your dashboard. The sidebar on the left is always visible and groups the app into sections:
- **BUILD**: Assistant, Call Flows, Message Flows, Crews, Workflows, Knowledge Base
- **DEPLOY**: Phone Numbers, Calls (Single Call, Batch Calls, Call Queues)
- **MONITOR**: Call History, Conversations, Analytics and more
- **ACCOUNT**: Billing and Settings
Some items only appear on certain plans. To build an AI phone agent, start with a call flow: in the sidebar, click **Call Flows**. (Text agents for SMS and chat live under **Message Flows**.)
### Understanding Call Flows
A call flow is the backbone of your AI agent. It holds the agent's instructions, voice, language model, greeting, tools and call settings, and it decides whether the agent makes calls, answers them, or both. You can think of it like a blueprint for your agent's calls.
- Your call flows are listed on this page for quick access
- You can group them into folders to keep your work organized
To begin building your first flow, click **New Call Flow**.
## 1.1 Create a Call Flow
**New Call Flow** opens a short wizard that asks, "What agent would you like to build today?" You have three ways to start:
- **Start from a template** (recommended). Templates are grouped into agents that **answer incoming calls** and agents that **make outgoing calls**, for example a receptionist or a booking agent. Picking one moves you straight to the next step.
- **Start from scratch**. Skips the wizard and opens an empty call flow editor where you write the prompt yourself.
- **Advanced** (Alpha, where available). Builds a node flow for multi-step logic, parallel API calls and custom code.
If you pick a template, the wizard has two more steps:
1. **Business**: "Whose calls will it handle?" Enter the business's website and Trillet reads it, or type the details in yourself if there's no website.
2. **Capabilities**: "What should it handle?" Tick what the agent should do on a call, such as answering questions, booking appointments or transferring to a human. Then click **Create agent**.
Trillet generates the agent and opens it in the call flow editor.
The direction you pick in the wizard can be changed later. In the editor, open **Settings > Greeting & Conversation > Call direction** and choose inbound, outbound or both.
## 1.2 Prompting Your Agent
The call flow editor has three parts:
- **Agent Instructions** on the left: the prompt the agent follows. Its toolbar holds the **language model** picker, the **voice** picker (voice, language, speaking speed and a fallback voice), **Variables** and **Prompt history**.
- **Settings** and **Tools** in the middle: greeting, call handling, phone line, knowledge base, transfers, webhooks and the rest of the flow's settings.
- **Test** on the right: try the agent before it goes live.
The way you prompt your agent determines how well it performs during conversations. Think of it like giving instructions to a teammate before they step into a meeting: the clearer and more specific you are, the better they'll handle the interaction.
You can also choose how your agent starts the call under **Settings > Greeting & Conversation**: let the caller speak first, or have the agent open with a greeting. The same page sets the agent's name, the greeting delay and whether callers can interrupt the greeting.
### Writing Effective Prompts
A strong prompt usually includes:
- **A clear goal** → what is the agent trying to achieve on this call?
- **Background context** → who is the agent, and what key details should they know?
- **Conversation flow** → the step-by-step path the agent should follow to reach the goal
**Example Prompt Structure:**
If your agent's goal is to qualify leads for a demo, your prompt might:
- Set the goal as confirming interest and booking a demo slot
- Provide background context like "You are Alex, a friendly sales assistant from Acme Software"
- Outline a conversation flow where the agent greets the lead, confirms their availability, and suggests two demo times
If you started from a template, the generated prompt already follows this structure. Edit it to fit your business.
### Testing Your Agent
Use the **Test** panel on the right of the editor, headed **Try your agent**:
- **Start test call** runs the agent in a voice call in your browser, so you can hear how it sounds.
- **Test by text instead** lets you chat with the agent and review its replies in writing.
The test runs your **draft**, including changes you haven't published yet.
It's always a good idea to test your prompt with different variations to see what gives you the most natural results.
### Publishing Your Changes
Edits in the call flow editor save automatically to a **draft**. Live callers, your phone numbers and your website widget keep using the published version until you click **Publish Changes** in the editor's header. Publish whenever you're happy with a change, and before you assign a phone number or place real calls. The header also has **Version history** and **Discard draft** if you want to go back.
## 1.3 Assigning a Phone Number
When you're ready to take your AI agent live, it needs a phone number that people can call. Assigning a number connects your agent to the outside world, so it can handle real conversations instead of just test runs.
In the sidebar, click **Phone Numbers**.
### Number Options
The Phone Numbers page gives you three ways to get a number:
**1. Buy a Number**
- Purchase directly through the platform
- Search by country, number type, and area code or region where available
**2. Connect WhatsApp**
- Connect a WhatsApp Business number so the agent can take WhatsApp calls
- Transfers aren't available on WhatsApp calls yet
**3. Bring Your Own**
- Link an existing number from a provider such as Twilio, Telnyx or your own SIP trunk
- Keep using your existing carrier rates
- Manage everything from within Trillet
### Number Assignment
Once you have a number, open its settings from the Phone Numbers list to assign it:
Configuration options include:
- **What should this number do?**: handle calls or handle messages
- **Choose an AI Agent**: the agent (call flow) the number connects to
- A label for the number, such as "Sales Line"
- Call recording and business hours for this number
- Custom tags (metadata) and secrets the agent can use during the call
The maximum call length is a call flow setting, not a number setting. Set it in the editor under **Settings > Call Handling > Call limits > Maximum call length**.
When everything is configured and your call flow is published, your number is live. Make a quick test call to confirm everything works as expected.
## 1.4 Sending and Receiving Calls
Once a phone number is assigned to your AI agent, it answers incoming calls (if the call flow accepts inbound calls) and can place outgoing ones.
### Single Calls
To place one outbound call: in the sidebar, go to **Calls > Single Call**.
Under **Agent**, choose the agent to make the call (it needs a phone number assigned), enter the number to call under **Phone Number**, and click **Start Call**.
You can also use our [Voice Calls API](/v1/api-reference/endpoints/calls/initiate-call) to programmatically initiate calls:
```bash
curl -X POST https://api.trillet.ai/v1/api/call \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"call_agent_id": "your_agent_id",
"to": "+1234567890"
}'
```
### Batch Calls
Trillet also gives you the ability to place batch calls. To access this feature: in the sidebar, go to **Calls > Batch Calls**.
Batch Calls let you reach multiple contacts at once instead of dialing them individually. This is especially helpful for:
- Lead reactivation campaigns
- Appointment reminders
- Survey collection
- Follow-up calls
**Setup Process:**
1. Choose the agent that will make the calls
2. Click **Download Template** for the CSV format, then **Upload Contact List** with your contacts
3. Start now, or schedule when the calls should go out
4. Click **Start Batch Call**
5. Track earlier batches under **Past Batches**
Defaults such as concurrency live in **Settings > Batch Call Settings**.
For large-scale operations, consider using our [Batch Calls API](/v1/api-reference/endpoints/calls/batch/overview) to programmatically manage batch calls and monitor their status.
## 1.5 Setting up Transfers
Transfers let your agent hand a call over to a real person or another system when needed. This is useful for situations where the conversation requires human support, a specialized team, or a different department.
### Transfer Setup Steps
1. In the call flow editor, open **Settings > Tools** and click **+ Add**
2. Choose **Call transfer** to send the caller to a person or phone number, or **Agent transfer** to hand the call to another of your AI agents
3. Give the transfer a **Name** (e.g., Support Team)
4. Fill in **When should the agent transfer?** in plain English. Be specific: the agent reads this to decide when to transfer
5. Under **Transfer to**, enter the destination, such as a phone number in E.164 format (`+12025550123`). Warm and whisper transfers also accept other destination types, such as a SIP address, under **Advanced type**
6. Pick a **Hand-off style** (see below)
7. Optionally set what the caller hears before the agent dials, and a **Transfer greeting** your team hears when they pick up
Each transfer appears as a card under **Tools > Transfers**. Click a card to edit it. Publish your changes to make new transfers live.
### Hand-off Styles
- **Cold**: connects the caller straight away, with no briefing for your team
- **Warm** (recommended): the agent tells your team who's calling and why as it connects; the call goes through either way
- **Whisper**: the caller waits while the agent speaks privately with your team, who can accept or decline the call
Make sure to test your transfer destinations to ensure they're properly configured and accessible.
## API Integration
Throughout this guide, we've focused on the visual interface, but every feature is also available through our comprehensive REST API:
Create and manage conversational agents programmatically
Design conversation flows via API
Initiate and manage calls programmatically
Handle real-time conversations
## Next Steps
Now that you've set up your first AI agent, explore these advanced features:
Track performance and optimize your agents
Learn advanced prompting techniques for better conversations
Connect your agent to external systems
## White-label
Trillet supports white-label for agencies and enterprises that offer AI voice agents under their own name: your own domain, branded email notifications and workspaces in your brand. Set it up under [Settings](https://app.trillet.ai/settings).
## Support & Resources
Complete API reference and examples
Join our developer community
Get a support plan for direct technical help and guidance
---
## Connect ChatGPT
*Add Trillet to ChatGPT as a custom MCP connector and sign in with your Trillet account.*
Add Trillet to ChatGPT once, then ask ChatGPT to build and edit your agents in any conversation. You sign in with your Trillet login. You don't need an API key.
ChatGPT gets a smaller set of Trillet tools than Claude and the other clients. Check [What ChatGPT can do](#what-chatgpt-can-do) before you start.
## Before you start
- **A Trillet account.** Sign up or log in at [app.trillet.ai](https://app.trillet.ai).
- **A ChatGPT plan that allows custom MCP connectors.** OpenAI decides which plans can add custom MCP servers and can change this at any time. At the time of writing, OpenAI's help center lists ChatGPT Business, Enterprise, and Edu, on ChatGPT on the web. Check [OpenAI's current guide](https://help.openai.com/en/articles/12584461-developer-mode-and-mcp-apps-in-chatgpt) for your plan.
- **ChatGPT on the web.** Add the connector at [chatgpt.com](https://chatgpt.com).
On a Business, Enterprise, or Edu workspace, your ChatGPT admin controls who can add custom MCP connectors. If you don't see the option to add one, see [For ChatGPT workspace admins](#for-chatgpt-workspace-admins) below.
## Add the Trillet connector
OpenAI updates the ChatGPT interface often, so labels can differ slightly in your account. The steps below follow OpenAI's current guide to [adding a custom MCP server](https://developers.openai.com/api/docs/guides/custom-mcp-server).
### 1. Open the custom MCP server form
In ChatGPT on the web, open **Plugins**, select the **+** button, then select **Add custom MCP server**.
In some accounts this area is called **Apps** (or **Apps & Connectors**) in **Settings**, and you first turn on **Developer mode** under **Advanced settings**, then select **Create**.
### 2. Enter the Trillet details
Fill in the form:
- **Name:** `Trillet`
- **Description:** `Build and edit my Trillet voice agents` (optional)
- **Server URL:** `https://mcp.trillet.ai/mcp`
- **Authentication:** **OAuth**
Leave any client ID and client secret fields empty. ChatGPT registers itself with Trillet automatically.
### 3. Accept the warning and create the connector
ChatGPT shows a warning that custom MCP servers are not verified by OpenAI. Select **I understand and want to continue**, then create the connector.
### 4. Log in to Trillet
ChatGPT opens a Trillet sign-in page. Log in with the account you use at [app.trillet.ai](https://app.trillet.ai).
### 5. Review and allow access
Trillet shows a consent screen titled **ChatGPT wants to access your Trillet account**. It lists what ChatGPT can view and do, and what it can't reach. See [Security and permissions](/mcp/security#what-it-cant-do) for exactly what a connection can and can't reach.
If you belong to more than one workspace, choose the workspace ChatGPT starts in. ChatGPT can reach all of your workspaces and switches when you ask.
Select **Allow access**. Trillet returns you to ChatGPT.
## What ChatGPT can do
A ChatGPT connection (and an OpenAI Codex connection) gets 24 of Trillet's tools. It gets no [prompts or resources](/mcp/prompts-and-resources).
| Area | Tools |
|---|---|
| Workspaces | `trillet_list_workspaces`, `trillet_switch_workspace` |
| Agents and voices | `trillet_list_agents`, `trillet_search_voices`, `trillet_create_agent`, `trillet_update_agent` |
| Call flows | `trillet_list_call_flows`, `trillet_get_call_flow`, `trillet_list_drafts`, `trillet_create_call_flow`, `trillet_update_prompt`, `trillet_set_post_call_analysis` |
| Call-flow settings | `trillet_set_transfers`, `trillet_set_office_hours`, `trillet_set_call_settings`, `trillet_set_speech_settings`, `trillet_set_welcome_message` |
| Knowledge bases | `trillet_list_knowledge_bases`, `trillet_create_knowledge_base`, `trillet_add_kb_text`, `trillet_attach_knowledge_bases` |
| Demo links | `trillet_list_demo_links`, `trillet_create_demo_link`, `trillet_set_demo_page_design` |
ChatGPT can't:
- Read call history, recordings, or transcripts. Real callers' words can hold health information, so call data stays in the Trillet dashboard.
- Run text test calls or place outbound calls.
- Search, buy, assign, or release phone numbers.
- Create, run, or turn on workflows, or manage secrets.
- Check usage, wallet balance, or transactions.
- Publish drafts or node flows, or delete anything.
- Upload a file to a knowledge base. Add the content as text instead.
Use the Trillet dashboard, or connect [Claude](/mcp/claude) or [another client](/mcp/claude-code-and-other-clients), for those.
Two tools work differently in ChatGPT:
- **`trillet_set_call_settings`** only changes how the call runs: silence handling, silence reminders, maximum call length and its closing message, the business time zone, and whether the agent knows the current date and time. Recording, transcript redaction, voicemail detection, and the other call settings stay in the dashboard.
- **`trillet_create_demo_link`** needs your explicit approval (`confirm: true`), and every link has limits. It expires after 14 days by default (at most 90). Each visitor can talk for 5 minutes by default (at most 30), and all visitors together for 60 minutes by default (at most 600). Anyone with the link can talk to your agent, and their minutes are billed to your workspace. To revoke a link, delete it on the call flow's demo links in the Trillet dashboard.
## Use Trillet in a chat
1. Start a new conversation.
2. Type `@` in the message box and select **Trillet**. Depending on your ChatGPT version, you can also select Trillet from the **+** menu in the message box.
3. Ask for what you want. For example:
```
Show me the prompt on my Reception call flow in Trillet and suggest three improvements.
```
ChatGPT works best when you name Trillet and say what you want done. For more ideas, see [What you can ask](/mcp/example-prompts).
### Confirming actions
ChatGPT asks you to approve any tool that changes something, such as updating a prompt or a call flow's settings. Check the details before you approve. You can choose to remember your decision for a tool for the rest of that conversation. A new conversation asks again.
Creating a public demo link also needs an explicit `confirm: true` from the assistant. ChatGPT is told to set it only after you approve the link in the chat.
## For ChatGPT workspace admins
On Business, Enterprise, and Edu workspaces, admins control custom MCP connectors in **Workspace settings**:
- **Business:** admins and owners create and publish custom MCP connectors for the workspace. Members connect within the permissions the workspace allows. The relevant permission is **Create plugins with MCPs**.
- **Enterprise and Edu:** admins can use role-based access control to let selected members create custom MCP connectors, and can choose who can use each approved connector. Only admins and owners can publish to the workspace. Admins can also turn individual actions on or off.
When an admin publishes a connector, ChatGPT keeps a snapshot of its tools. When Trillet adds new tools, an admin needs to refresh the connector and publish the update before members see them.
OpenAI documents these controls in [Admin controls, security, and compliance for plugins and apps](https://help.openai.com/en/articles/11509118-admin-controls-security-and-compliance-for-plugins-and-apps).
## Disconnect ChatGPT
You can remove access from either side:
- **In Trillet:** go to **Settings > Account > Connected Apps** and select **Disconnect** next to ChatGPT. Access stops straight away.
- **In ChatGPT:** remove or disconnect the Trillet connector from your plugin or app settings.
See [Security and permissions](/mcp/security#disconnect-an-assistant) for details.
## Next steps
Example prompts for building, testing, and reviewing agents.
Fixes for sign-in, workspace, and tool errors.
---
## Claude Code and other MCP clients
*Connect Claude Code, Cursor, and other MCP clients to Trillet with an API key, over the hosted server or the local npm package.*
ChatGPT and Claude.ai sign in to Trillet with your login. Developer tools such as Claude Code and Cursor usually connect with an **API key** instead. This page covers those setups.
| | Hosted server | Local package |
|---|---|---|
| **How** | Your client connects to `https://mcp.trillet.ai/mcp` | Your client runs `npx -y @trillet-ai/mcp@latest` on your computer |
| **Needs** | A client that supports remote MCP servers and custom headers | Node.js 18 or later |
| **Good for** | Claude Code, and any client that speaks Streamable HTTP | Cursor, Windsurf, and any client that runs local (stdio) servers |
| **Version** | 0.10.0, always the current release | The latest version on npm, currently 0.8.1 |
Both routes act on the same Trillet account, but they don't offer the same features yet. The npm package is behind the hosted server:
| | Hosted server (0.10.0) | npm package (0.8.1) |
|---|---|---|
| Tools | All 85 in the [tool reference](/mcp/tools/index) | 83: no `trillet_list_workspaces` or `trillet_switch_workspace` |
| `workspace_id` | Workspace id or name | Workspace id only |
| Text test calls | `trillet_say` and `trillet_end_text_call` take `text_call_id` | They take `session_id` instead |
| [Prompts, resources, confirmation forms, progress, structured results](/mcp/prompts-and-resources) | Yes | No |
| Uploading a file from your computer to a knowledge base (`file_path`) | No | Yes |
Use the hosted server if you want everything in these docs. The tool reference describes the hosted server.
## Before you start
You need two values from the [Trillet dashboard](https://app.trillet.ai).
**Settings > Developer > API Keys.** Create a key and copy it. It is shown only once.
**Settings > Workspace > Workspace Details.** A 24-character id with a copy button. You can also use **Copy workspace ID** in the workspace switcher.
Don't see **API Keys** under **Developer**? API keys are not available on SMB plans, and on other plans you need the `api_keys:view` permission. Ask a workspace owner to create a key for you or to grant the permission.
An API key acts as you, with your role, in every workspace you belong to, not just the one you set here. Keep it out of shared chats, screenshots, and source control. You can revoke a key and create a new one at any time on the same settings page.
## Claude Code
Add the hosted server with your API key and workspace id:
```bash
claude mcp add --transport http trillet https://mcp.trillet.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY" \
--header "X-Trillet-Workspace-Id: YOUR_WORKSPACE_ID"
```
Check that it is connected:
```bash
claude mcp list
```
Then ask Claude Code to "list my Trillet agents" to confirm your key works.
To run the server locally instead, use `claude mcp add trillet -e TRILLET_API_KEY=YOUR_API_KEY -e TRILLET_WORKSPACE_ID=YOUR_WORKSPACE_ID -- npx -y @trillet-ai/mcp@latest`.
## Cursor and other local clients
The server is published on npm as [`@trillet-ai/mcp`](https://www.npmjs.com/package/@trillet-ai/mcp). It reads your credentials from environment variables.
### Cursor
Add this to `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project):
```json
{
"mcpServers": {
"trillet": {
"command": "npx",
"args": ["-y", "@trillet-ai/mcp@latest"],
"env": {
"TRILLET_API_KEY": "YOUR_API_KEY",
"TRILLET_WORKSPACE_ID": "YOUR_WORKSPACE_ID"
}
}
}
}
```
### Other clients
Any MCP client that runs local servers can start Trillet with:
```bash
TRILLET_API_KEY=YOUR_API_KEY \
TRILLET_WORKSPACE_ID=YOUR_WORKSPACE_ID \
npx -y @trillet-ai/mcp@latest
```
Optional: set `TRILLET_API_URL` to change the API base URL. The default is `https://api.trillet.ai`.
## Claude Desktop extension
Most Claude Desktop users should use the [Claude connector](/mcp/claude) instead. It signs in with your Trillet login and stays up to date on its own.
If you use the Trillet Desktop extension (`trillet.mcpb`):
- It stores your API key in your operating system's keychain.
- **Claude Desktop never updates extensions automatically.** To get a new version, get the latest `trillet.mcpb` from Trillet support and install it again.
- To see which version you have, open **Settings > Extensions** in Claude Desktop and select Trillet.
- Versions before 0.8.3 can't finish text test calls. See [Troubleshooting](/mcp/troubleshooting#text-test-calls).
To install or update, open `trillet.mcpb` (double-click it or drag it into Claude Desktop), then enter your API key and workspace id when asked.
## Hosted server reference
Use this section to connect a client that is not listed above.
```
POST https://mcp.trillet.ai/mcp
```
The server uses Streamable HTTP. ChatGPT, Claude.ai, and Claude Desktop sign in with a Trillet login over OAuth. Another client can use OAuth only if it receives the sign-in on a loopback address (`localhost`, `127.0.0.1`, or `[::1]`). Trillet refuses other redirect addresses, including custom schemes such as `cursor://`, so use an API key with Cursor and with any client whose sign-in doesn't come back to a loopback address. Clients that send headers can use an API key:
`Bearer `
The 24-character id of the workspace to work in.
The REST API uses an `x-api-key` header. The MCP server uses `Authorization: Bearer` because that is the header MCP clients send.
If your client can set only one header, pass the workspace id in the URL instead:
```
https://mcp.trillet.ai/mcp?workspace=YOUR_WORKSPACE_ID
```
The workspace id is not a secret, so it is safe in a URL. The API key is accepted only in the `Authorization` header, never in the URL, so it stays out of browser history and server logs.
To check connectivity from a terminal:
```bash
curl -X POST https://mcp.trillet.ai/mcp \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "X-Trillet-Workspace-Id: YOUR_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": { "name": "my-client", "version": "1.0.0" }
}
}'
```
A successful response includes an `Mcp-Session-Id` header. Send it with every later request in the session.
## Work in other workspaces
Every tool accepts an optional `workspace_id`, so one connection can work across several workspaces as long as your API key's user is a member of each. Ask "list the agents in workspace `a3a3a3a3a3a3a3a3a3a3a3a3`" and the assistant passes the id through. On the hosted server you can also use the workspace name.
---
## Connect Claude
*Add Trillet to Claude.ai and Claude Desktop as a custom connector and sign in with your Trillet account.*
Add Trillet to Claude once and use it in Claude.ai, Claude Desktop, and the Claude mobile apps. You sign in with your Trillet login. You don't need an API key.
Custom connectors are tied to your Claude account, so a connector you add in Claude.ai also works in Claude Desktop, and the reverse.
## Before you start
- **A Trillet account.** Sign up or log in at [app.trillet.ai](https://app.trillet.ai).
- **A Claude plan.** Anthropic offers custom connectors on the Free, Pro, Max, Team, and Enterprise plans. Free plans are limited to one custom connector. Check [Anthropic's current guide](https://support.claude.com/en/articles/11175166-get-started-with-custom-connectors-using-remote-mcp) for the latest plan details.
- **On a Team or Enterprise plan,** an owner adds the connector for the organization first. See [Team and Enterprise plans](#team-and-enterprise-plans).
## Add the Trillet connector (Free, Pro, and Max)
### 1. Open Connectors
In Claude.ai or Claude Desktop, go to **Customize > Connectors**.
### 2. Add a custom connector
Select **+ Add**, then **Add custom connector**.
### 3. Enter the Trillet details
- **Name:** `Trillet`
- **Remote MCP server URL:** `https://mcp.trillet.ai/mcp`
Select **Continue**. Claude detects that Trillet uses OAuth sign-in. Keep the detected settings and select **Continue** again.
### 4. Keep the recommended sign-in settings
- **Authentication:** **Sign in now**
- **OAuth client:** **Use Claude's published identity (Recommended)**
- **Request headers:** leave empty
Select **Add**.
### 5. Log in to Trillet and allow access
Claude opens a Trillet sign-in page. Log in, then review the consent screen titled **Claude wants to access your Trillet account**.
If you belong to more than one workspace, choose the workspace Claude starts in. Claude can reach all of your workspaces and switches when you ask.
Select **Allow access**. Trillet returns you to Claude.
## Team and Enterprise plans
An owner adds Trillet to the organization once. Each member then connects with their own Trillet login, so everyone only reaches their own Trillet workspaces.
**Owners** (on Enterprise, also custom roles with **Manage access to Libraries**):
1. Go to **Organization settings > Connectors**.
2. Select **Add**, hover over **Custom**, and select **Web**.
3. Enter the name `Trillet` and the URL `https://mcp.trillet.ai/mcp`, then select **Continue**.
4. Keep the detected settings: **Authentication** set to a sign-in option, **OAuth client** set to **Use Claude's published identity (Recommended)**, and no request headers. Select **Add**.
**Members:**
1. Go to **Customize > Connectors**.
2. Find **Trillet**, labeled **Custom**.
3. Select **Connect**, log in to Trillet, and select **Allow access**.
Don't add a Trillet API key as a request header on an organization connector. A header is shared by everyone in the organization, so every member would act as the owner of that key. Use OAuth sign-in so each member connects as themselves.
## Use Trillet in a chat
1. Start a new conversation.
2. Select the **+** button at the lower left of the message box, then **Connectors**.
3. Make sure **Trillet** is turned on for the conversation.
4. Ask for what you want. For example:
```
Show me the last 10 calls to my Reception agent and summarise anything that went wrong.
```
Claude may ask for your permission before it uses a Trillet tool. Read what it plans to do before you allow it. For outbound calls, phone number purchases, workflow runs, and deletes, the assistant is told to ask you in the chat before it goes ahead. Text test calls run without that step. See [Security and permissions](/mcp/security#actions-that-are-real-and-billed).
For more ideas, see [What you can ask](/mcp/example-prompts).
## Already using the Trillet Desktop extension?
If you installed the Trillet extension (`trillet.mcpb`) in Claude Desktop with an API key, you can keep using it or move to the connector. The connector updates on its own, works in Claude.ai and on mobile, and signs in without an API key.
To switch, add the connector as above, then turn off or remove the extension in Claude Desktop under **Settings > Extensions**. Keep only one of them enabled, so Claude doesn't see two copies of every Trillet tool. See [Claude Code and other clients](/mcp/claude-code-and-other-clients#claude-desktop-extension) for more on the extension.
## Disconnect Claude
You can remove access from either side:
- **In Trillet:** go to **Settings > Account > Connected Apps** and select **Disconnect** next to Claude. Access stops straight away.
- **In Claude:** go to **Customize > Connectors**, select the three dots next to Trillet, and remove it. Team and Enterprise owners can remove it for everyone in **Organization settings > Connectors**.
See [Security and permissions](/mcp/security#disconnect-an-assistant) for details.
## Next steps
Example prompts for building, testing, and reviewing agents.
Fixes for sign-in, workspace, and tool errors.
---
## What you can ask
*Example prompts for building, testing, and reviewing Trillet agents from ChatGPT, Claude, and other AI assistants.*
Talk to the assistant the way you would brief a colleague. Say which agent or workspace you mean, what you want changed, and what a good result looks like. The assistant reads your current setup before it changes anything.
These prompts work in Claude, Claude Code, and any other client connected to Trillet. In ChatGPT, only the prompts that build and edit agents, call flows, and text knowledge bases work: ChatGPT can't run text test calls, read calls, manage phone numbers or workflows, or check usage. See [What ChatGPT can do](/mcp/chatgpt#what-chatgpt-can-do).
## Build an agent
```
Build an inbound receptionist for Harbour Dental. It should answer questions about
opening hours (Mon to Fri 8am to 6pm, Sat 9am to 1pm), take booking requests, and
transfer urgent calls to +61 2 9000 1234. Use a warm Australian female voice.
```
```
Change the welcome message on my Reception agent to "Thanks for calling Harbour Dental,
this is Mia. How can I help?" and make it slightly more patient with interruptions.
```
```
Create a knowledge base called "Harbour Dental FAQ" from https://harbourdental.example/faq.pdf
and attach it to the Reception agent.
```
The link must point to a file (PDF, DOCX, TXT, MD, CSV, or JSON, up to 20 MB), not a web page. Each knowledge base holds one file, and uploading another replaces it. You can also paste text and ask the assistant to add it.
## Test it with a text call
```
Run a text test call with my Reception agent. Play a caller who wants to move their
Thursday appointment to next week and is in a hurry. Tell me where the agent struggled.
```
```
Test the after-hours flow as a caller with a dental emergency. Check that the agent
offers the transfer and doesn't try to book an appointment.
```
A text test call is a real call to your agent over text. It costs a few cents in model usage, and anything the agent does during the call happens for real, such as creating a booking or sending a webhook. Point test calls at test calendars and endpoints where you can.
## Review real calls
```
Review the last 20 calls to my Reception agent and list the problems you see,
with the transcript lines that show each one.
```
```
Why did yesterday's 3:42pm call end without a transfer? Show me what the caller asked for.
```
```
How many calls did we take last week, and what was the average call length?
```
## Work across workspaces
```
List my workspaces.
```
```
Switch to Bayview Physiotherapy and show me its agents and phone numbers.
```
## Phone numbers
```
Find a local Sydney number and assign it to the Reception agent. Tell me the
monthly cost before you buy it.
```
```
Which of my numbers aren't assigned to an agent?
```
## Workflows
```
Create a workflow that sends me an SMS summary after every missed after-hours call.
Run a test first and show me the result before you turn it on.
```
```
Why did the "New lead follow-up" workflow fail this morning?
```
## Usage and billing
```
How much have we spent on calls this month, and what is my wallet balance?
```
## Tips for good results
- **Name things.** "The Reception agent in Harbour Dental" is faster and safer than "my agent".
- **Ask it to look first.** "Show me the current prompt, then suggest changes" lets you review before anything changes.
- **Test after every change.** End a build request with "then run a text test call as a new patient".
- **Keep real-world actions explicit.** The assistant is told to ask before it calls a phone, buys a number, runs a workflow, or deletes something. Text test calls and turning on a workflow don't need a confirmation, so say so if you want to approve those first. Read the details before you confirm.
## Full tool list
The hosted server at `https://mcp.trillet.ai/mcp` offers 85 tools (24 in [ChatGPT](/mcp/chatgpt#what-chatgpt-can-do)). You don't need to name them; the assistant picks the right one. They are listed here for reference. The [tool reference](/mcp/tools/index) has every parameter and what each tool returns.
### Workspaces (2 tools)
`trillet_list_workspaces`, `trillet_switch_workspace`
### Agents and voices (6 tools)
`trillet_list_agents`, `trillet_get_agent`, `trillet_create_agent`, `trillet_update_agent`, `trillet_delete_agent`, `trillet_search_voices`
### Call flows (13 tools)
`trillet_list_call_flows`, `trillet_get_call_flow`, `trillet_create_call_flow`, `trillet_update_call_flow`, `trillet_update_prompt`, `trillet_set_incall_api_tools`, `trillet_set_post_call_analysis`, `trillet_list_drafts`, `trillet_deactivate_drafts`, `trillet_publish_draft`, `trillet_duplicate_call_flow`, `trillet_archive_call_flow`, `trillet_delete_call_flow`
### Flow settings (8 tools)
`trillet_set_transfers`, `trillet_set_office_hours`, `trillet_set_call_settings`, `trillet_set_speech_settings`, `trillet_set_welcome_message`, `trillet_set_code_actions`, `trillet_set_background_audio`, `trillet_set_security_settings`
### Node flows (10 tools)
`trillet_node_flow_reference`, `trillet_list_node_flows`, `trillet_get_node_flow`, `trillet_create_node_flow`, `trillet_list_node_flow_templates`, `trillet_update_node_graph`, `trillet_validate_node_graph`, `trillet_publish_node_graph`, `trillet_simulate_node_graph`, `trillet_list_node_flow_runs`
### Phone numbers (8 tools)
`trillet_list_phone_numbers`, `trillet_search_available_numbers`, `trillet_purchase_phone_number`, `trillet_bind_phone_number`, `trillet_release_phone_number`, `trillet_get_phone_number_config`, `trillet_update_phone_number_config`, `trillet_register_external_number`
### Knowledge bases (7 tools)
`trillet_list_knowledge_bases`, `trillet_get_knowledge_base`, `trillet_create_knowledge_base`, `trillet_add_kb_text`, `trillet_upload_kb_file`, `trillet_attach_knowledge_bases`, `trillet_delete_knowledge_base`
### Workflows (12 tools)
`trillet_workflow_reference`, `trillet_list_workflows`, `trillet_get_workflow`, `trillet_create_workflow`, `trillet_update_workflow`, `trillet_activate_workflow`, `trillet_pause_workflow`, `trillet_delete_workflow`, `trillet_test_workflow`, `trillet_run_workflow`, `trillet_list_workflow_runs`, `trillet_get_workflow_run`
### Calls (5 tools)
`trillet_list_calls`, `trillet_get_call_metrics`, `trillet_get_call`, `trillet_review_calls`, `trillet_start_outbound_call`
### Text test calls (3 tools)
`trillet_start_text_call`, `trillet_say`, `trillet_end_text_call`
### Website widget and demo pages (6 tools)
`trillet_get_website_widget`, `trillet_set_website_widget`, `trillet_list_demo_links`, `trillet_create_demo_link`, `trillet_set_demo_page_design`, `trillet_upload_demo_page_logo`
### Secrets (3 tools)
`trillet_list_secrets` (values are always masked), `trillet_set_secret`, `trillet_delete_secret`
### Usage and billing (2 tools)
`trillet_get_usage`, `trillet_list_transactions`
---
## Prompts, resources, and confirmations
*Ready-made Trillet workflows, readable guides and records, confirmation forms, progress updates, and structured results in the Trillet MCP server.*
Besides its 85 [tools](/mcp/tools/index), the Trillet MCP server offers the other parts of the Model Context Protocol: prompts, resources, confirmation forms, progress updates, and structured results. Clients that support them get a smoother experience. Clients that don't keep working exactly as before.
These features are live on the hosted server at `https://mcp.trillet.ai/mcp` from version 0.10.0. The `@trillet-ai/mcp` npm package (currently 0.8.1) doesn't have them yet. ChatGPT and Codex connections get no prompts or resources; see [What ChatGPT can do](/mcp/chatgpt#what-chatgpt-can-do).
## Prompts
Prompts are ready-made tasks. In clients that show them, they appear as slash commands or in a prompt menu, and they ask for the details they need.
| Prompt | You provide | What it does |
|---|---|---|
| `build-agent` | Business description (required), voice, workspace | Builds a production agent end to end, following Trillet's prompt guide, then tests it with a text call. |
| `build-demo` | Prospect (required), the moment that should impress, workspace | Builds a demo agent for a fictional version of the prospect's business, plus a short demo script. |
| `test-agent` | Call flow (required), scenarios, workspace | Runs scripted text test calls, reports PASS or FAIL per scenario, and suggests the smallest prompt fix for each failure. |
| `debug-call` | What went wrong (required), call id, call flow, workspace | Reads the transcript and configuration, finds the cause, and proposes a fix before changing anything. |
| `weekly-call-review` | Call flow, number of days, workspace | Summarises the last N days: call metrics, the top three problems with the calls that show them, and suggested fixes. |
| `launch-checklist` | Call flow (required), workspace | Checks a flow is ready for real callers: model, speech settings, transfers, voicemail, office hours, knowledge base, tests, phone number, and wallet balance. |
Call flow and workspace fields suggest values from your account as you type.
In Claude Code, run them as `/mcp__trillet__build-agent` and so on. You can also just ask in plain language, for example "Test the Reception flow with three new-patient scenarios"; the assistant does the same work with tools.
## Resources
Resources are documents the assistant (or you) can attach to a conversation without calling a tool.
**Guides**
| Resource | Content |
|---|---|
| `trillet://docs/platform-rules` | Platform rules and known failure signatures |
| `trillet://docs/agent-prompt-guide` | How to structure an agent prompt, with production defaults |
| `trillet://docs/node-flows` | Node flow reference |
| `trillet://docs/workflows` | Workflow reference |
| `trillet://docs/voices` | Voices, languages, pronunciation, and speech settings |
**Your account**
| Resource | Content |
|---|---|
| `trillet://workspaces` | The workspaces you can use, with the current one marked |
| `trillet://agents/{agentId}` | An agent's configuration |
| `trillet://call-flows/{flowId}` | A call flow, including its prompt |
| `trillet://calls/{callId}/transcript` | A call transcript with time, direction, duration, status, and summary |
| `trillet://workflows/{workflowId}` | A workflow definition |
These read the current workspace. To read from another workspace, prefix the path with the workspace id or URL-encoded name, for example `trillet://workspaces/Bondi%20Dental/agents/`.
In Claude Code, attach one with `@`, for example `@trillet:trillet://docs/agent-prompt-guide`.
## Confirmation forms
Twelve actions spend money or can't be undone. Before they run, clients that support MCP forms (elicitation) show a confirmation that names exactly what will happen, for example:
> Permanently delete agent "Sarah" from workspace "Acme Agency"?
If you decline, nothing happens. The actions are:
- Buy a phone number, release a number from an agent, register an external number
- Start an outbound call
- Run a workflow for real
- Publish a call flow draft or a node graph
- Delete an agent, call flow, knowledge base, workflow, or secret
In clients without forms, Trillet can't ask you directly. Most of these tools then need the assistant to pass `confirm: true`, and the assistant is told to ask you in the chat first. Your client's own approval prompt still applies. Claude Code may show both its permission prompt and the form for these actions.
## Progress updates
Longer actions report progress while they run: text test calls (connecting, waiting for the agent), knowledge base file uploads, call reviews, usage summaries, and waiting for you to answer a confirmation form. Clients that show progress display it; others simply wait for the result.
## Structured results
41 tools, including every list and get tool, text calls, and the main edit tools, return typed data alongside the usual text. Assistants read these results more reliably, for example when comparing calls or totalling usage. The text result is unchanged, so nothing depends on structured support.
## Client support
What each client supports, based on its published documentation as of October 2026.
| Client | Tools | Resources | Prompts | Confirmation forms | Progress | Structured results |
|---|---|---|---|---|---|---|
| Claude Code | Yes | Yes | Yes | Yes | Yes | Not documented |
| Cursor | Yes | Yes | Yes | Yes | Not documented | Not documented |
| VS Code | Yes | Yes | Yes | Not documented | Not documented | Not documented |
| ChatGPT | 24 tools ([which ones](/mcp/chatgpt#what-chatgpt-can-do)) | Not offered | Not offered | Not documented | Not documented | Yes |
| Claude.ai and Claude Desktop | Yes | Not documented | Not documented | Not documented | Not documented | Not documented |
"Not documented" means the feature falls back gracefully: everything still works through tools and chat. "Not offered" means Trillet doesn't provide it to that client.
---
## Security and permissions
*What an AI assistant can and can't do in your Trillet account, what costs money, and how to disconnect.*
When you connect ChatGPT or Claude to Trillet, the assistant works as you. This page explains what that means and how to stay in control.
## What the assistant can do
The connection acts as you in your workspaces, within your Trillet role. Through Trillet's tools, a Claude connection can:
- **View** agents, call flows, call history, recordings and transcripts, phone numbers, knowledge bases, workflows, and your wallet balance, usage, and transactions.
- **Build and edit** agents, call flows, node flows, knowledge bases, workflows, your website widget, and demo pages.
- **Place calls**, including text test calls and outbound calls to real phone numbers.
- **Buy, assign, and release** phone numbers.
A ChatGPT or Codex connection gets a smaller set of tools: it can build and edit agents, call flows, call-flow settings, text knowledge bases, and demo links, and nothing else. It can't read call data. See [What ChatGPT can do](/mcp/chatgpt#what-chatgpt-can-do).
It can work in every workspace you belong to. You pick the workspace it starts in on the consent screen, and it switches when you ask.
## What it can't do
- It can't change your **password** or **email address**, and it can't see or create **API keys**. Trillet blocks these for connected apps whatever your role.
- It can't reach any workspace you are not a member of. Trillet checks your membership on every request, not just when you connect.
- It can't do anything your own Trillet login can't do.
## Actions that are real and billed
Some tools affect the outside world or cost money. They run for real and are charged to the workspace wallet:
| Action | What happens |
|---|---|
| Outbound call | Trillet calls the phone number you give. The call is billed like any other call. |
| Text test call | A real call to your agent over text. It costs a few cents in model usage. Bookings, webhooks, and other actions the agent takes during the call happen for real. |
| Buy a phone number | The number is purchased and its monthly cost is billed. |
| Run a workflow | The workflow runs with real side effects, such as sending messages or calling webhooks. |
| Turn on a workflow | The workflow starts running on its triggers, with the same real side effects. |
| Delete | Agents, call flows, knowledge bases, workflows, and secrets are removed. |
| Release a number | The number stops routing to that agent. It stays in your workspace. |
How these are checked:
- Buying, registering, or releasing a number, placing an outbound call, running a workflow, publishing a draft or node flow, and deleting an agent, call flow, knowledge base, workflow, or secret are [confirmation actions](/mcp/prompts-and-resources#confirmation-forms). In clients that support MCP forms, Trillet shows you a confirmation form before the tool runs.
- In other clients, Trillet can't show you a form. Most of these tools then need the assistant to pass `confirm: true`, and the assistant is told to ask you first. Read what the assistant says it will do before you agree.
- Text test calls and turning on a workflow have no Trillet confirmation step.
ChatGPT and Claude may also ask you to approve tool use. Read the details before you approve.
Keep test calls away from production systems where you can. Point booking and webhook tools at test calendars and test endpoints while you are building.
## Disconnect an assistant
You can remove an assistant's access at any time. It stops working straight away, in all of your workspaces.
### 1. Open Connected Apps
In the [Trillet dashboard](https://app.trillet.ai/settings?section=connected-apps), go to **Settings > Account > Connected Apps**. Each connected assistant shows when you connected it, when it was last used, and the workspace it starts in.
### 2. Disconnect
Select **Disconnect** next to the assistant, then confirm.
To use the assistant with Trillet again, connect from ChatGPT or Claude. You will see the consent screen again.
You can also remove the Trillet connector inside ChatGPT or Claude. Removing it there stops that app from using it. Disconnecting in Trillet makes sure access is revoked on Trillet's side too.
## API keys
Claude Code, Cursor, and other developer tools usually connect with an API key instead of a login.
- An API key acts as its user, with that user's role, in every workspace the user belongs to. Treat it like a password.
- Trillet accepts the key only in the `Authorization` header, never in a URL.
- Revoke a key at any time in **Settings > Developer > API Keys**. Revoking stops it working straight away on every connection that uses it.
## Use connectors you trust
ChatGPT and Claude warn that custom connectors are not verified by OpenAI or Anthropic. Only add the Trillet connector using the exact URL `https://mcp.trillet.ai/mcp`. Be careful when the assistant reads content from outside sources in the same conversation, such as web pages or shared documents, because that content can try to steer the assistant. Review actions before you approve them.
---
## MCP troubleshooting
*Fixes for common problems connecting ChatGPT, Claude, and other MCP clients to Trillet.*
## Connecting
### ChatGPT doesn't show an option to add a custom MCP server
OpenAI controls which plans and workspaces can add custom MCP connectors.
- Check that you are using ChatGPT on the web at [chatgpt.com](https://chatgpt.com).
- Check that your plan supports custom MCP connectors in [OpenAI's guide](https://help.openai.com/en/articles/12584461-developer-mode-and-mcp-apps-in-chatgpt).
- If you are on a Business, Enterprise, or Edu workspace, ask your ChatGPT admin to allow custom MCP connectors for you, or to add Trillet for the workspace. See [For ChatGPT workspace admins](/mcp/chatgpt#for-chatgpt-workspace-admins).
- In some accounts you need to turn on **Developer mode** first, under **Settings > Apps > Advanced settings**.
### Claude doesn't let me add a custom connector
- On the Free plan you can add one custom connector. Remove an unused one first.
- On Team and Enterprise plans, only owners (and Enterprise roles with **Manage access to Libraries**) can add connectors. Ask an owner to add Trillet in **Organization settings > Connectors**, then connect it yourself in **Customize > Connectors**.
### The sign-in or consent page shows an error or says the request expired
The sign-in link is valid for a short time. Close the Trillet tab, go back to ChatGPT or Claude, and start the connection again.
### The consent screen shows the wrong Trillet account
Select **Switch account** at the top of the consent screen and log in with the account you want to connect.
## Using Trillet in a chat
### Every Trillet tool fails with Unauthorized
The connection has lost access. This happens after you disconnect the app in Trillet, or when its sign-in has expired.
- **ChatGPT or Claude:** reconnect the Trillet connector in ChatGPT's plugin or app settings, or in Claude's **Customize > Connectors**. Log in and select **Allow access** again.
- **API key clients:** check the key is still listed in **Settings > Developer > API Keys**, and that its user is a member of the workspace id you set. The connection can look healthy while the key is wrong, so ask the assistant to "list my agents" to confirm.
### The assistant doesn't use Trillet
- **ChatGPT:** type `@` and select **Trillet** in the message box, or name Trillet in your request.
- **Claude:** select **+** in the message box, then **Connectors**, and make sure **Trillet** is on for this conversation.
### Workspace not found, or the assistant is working in the wrong workspace
Ask the assistant to "list my workspaces". It shows every workspace you belong to and marks the current one. Then ask it to switch, for example "switch to Acme Clinic Northside".
If a workspace is missing from the list, your Trillet account is not a member of it. Ask the workspace owner to invite you.
### My changes don't show up on test calls
The call flow probably has an active draft from the dashboard editor. A draft overrides the live version for test calls. Ask the assistant to "check whether this call flow has an active draft", then either publish the draft or deactivate it.
### A Trillet tool isn't available in ChatGPT
ChatGPT gets 24 of Trillet's tools. Tools for calls, text test calls, phone numbers, workflows, secrets, usage, publishing, and deleting are not offered in ChatGPT at all. See [What ChatGPT can do](/mcp/chatgpt#what-chatgpt-can-do).
For a tool on that list, ChatGPT keeps a snapshot of a connector's tools. Refresh the Trillet connector from its details page in ChatGPT's app settings. On Business, Enterprise, and Edu workspaces, an admin needs to refresh and publish the update.
### Uploading a file to a knowledge base fails
The hosted server can't read files from your computer. Give the assistant a public link to the file (for example `https://harbourdental.example/price-list.pdf`), or paste the text into the chat and ask it to add the text to the knowledge base.
## Text test calls
### Text call stops after the greeting
If the agent greets you and then every reply fails with `Required` at `session_id`, you are using an older Trillet extension in Claude Desktop. Versions before 0.8.3 are affected.
Fix it in one of two ways:
- **Use the Claude connector instead.** See [Connect Claude](/mcp/claude). It is always up to date.
- **Reinstall the extension.** Get the latest `trillet.mcpb` from Trillet support and install it again. Claude Desktop never updates extensions on its own. Check your version in **Settings > Extensions**.
### A text call won't start because too many are running
There are two limits:
- **Your own calls.** You can run two text test calls at the same time per workspace. The error says `You already have 2 active text calls`. Ask the assistant to end the calls you have finished with, then start a new one.
- **The hosted server.** The hosted server runs a limited number of text calls across all users. The error says `The platform is at its text-call capacity right now. Try again in a minute.` Wait a minute and try again.
### A text call created a booking or sent a webhook
Text test calls are real calls. Anything the agent does during the call, such as booking an appointment or calling a webhook, happens for real. Use test calendars and endpoints while you build, and cancel any test bookings afterwards.
## API key and local setups
### Authentication required
The full message is `Authentication required. Connect with OAuth, or send Authorization: Bearer .` The hosted server returned `401` because the `Authorization` header is missing or malformed. It must be `Authorization: Bearer YOUR_API_KEY`: the word `Bearer`, one space, then the key.
### Missing Trillet workspace
The full message is `Missing Trillet workspace. Send X-Trillet-Workspace-Id or ?workspace=.` The `X-Trillet-Workspace-Id` header is missing. Add it, or add `?workspace=YOUR_WORKSPACE_ID` to the server URL if your client can set only one header.
### Session not found or expired. Start a new session.
The hosted server closes a session after 15 minutes without requests, and when it restarts. Reconnect your client, or send a new `initialize` request without an `Mcp-Session-Id` header.
### Send an initialize request first, without an Mcp-Session-Id header.
The first request of a session must be `initialize`, sent without an `Mcp-Session-Id` header. Use the session id from its response on every later request.
### This session belongs to a different user or API key
A session is tied to the key or login that opened it. The `403` means a later request used a different key or account, or a different app's sign-in (`This session belongs to a different client`). Start a new session with the credentials you want to use.
### Too many open sessions. Try again shortly.
The hosted server has reached its limit of open sessions (`503`). Wait a moment and reconnect. Close sessions your client no longer uses.
### Could not verify the access token right now
A `503` from the hosted server while it checks a ChatGPT or Claude sign-in. Your connection is still valid; wait a few seconds and try again.
### npx can't find or start the package
You need Node.js 18 or later. Run `node --version` to check, then run `npx -y @trillet-ai/mcp@latest` in a terminal to see the full error.
## Still stuck?
Ask in the Trillet community.
What the connection can do and how to disconnect it.
---
## Trillet OEM authentication
*Trillet OEM partner keys, scopes, tenant restrictions, and calling standard endpoints on behalf of a tenant.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
## Partner keys
Every Trillet OEM request is authenticated with a **partner key**, sent as a bearer token in the `Authorization` header:
```bash
curl https://api.trillet.ai/partner/v1/key \
-H "Authorization: Bearer tpk_live_..."
```
- Keys start with `tpk_live_`.
- A key is shown **once**, when you create it. Trillet stores only a hash, so a lost key cannot be recovered. Create a new one and revoke the old one.
- Keys are created and revoked in the **OEM API** section of your account settings, by an owner or admin of your partner account. Each key shows its name, prefix, scopes, allowed tenants and when it was last used.
- A key acts as your partner account, not as a person, so it keeps working when staff leave. Keys do not expire. Revoking a key takes effect immediately.
- An account can hold up to 50 active keys.
- Send a partner key only in `Authorization`. Sending it in `x-api-key` is refused with `401`, and sending both a partner key and an `x-api-key` returns `400` `conflicting_credentials`.
Treat partner keys like passwords. Keep them on your server, never in a browser or mobile app.
### Check a key
`GET /partner/v1/key` returns the key's mode, scopes, tenant restriction and your partner account. It needs no scope.
```json
{
"object": "partner_key",
"id": "b3b3b3b3b3b3b3b3b3b3b3b3",
"mode": "live",
"scopes": ["tenants:read", "tenants:write", "resources:read", "usage:read"],
"tenantIds": [],
"partner": {
"id": "b0b0b0b0b0b0b0b0b0b0b0b0",
"name": "Example Health",
"maxTenants": 100,
"tenantCount": 12
}
}
```
`maxTenants` is the number of tenants your account may hold. Ask your account manager to raise it.
`tenantCount` is the number of tenants counted against `maxTenants`: every tenant your account holds that is `active`, `suspended` or `provisioning_failed`. It goes up when a tenant is created or restored and down when one is deleted, so deleted tenants are not counted, even while they can still be restored. It covers your whole account, not only the tenants a restricted key can see.
## Scopes
Give each key only the scopes it needs. A new key has every scope unless you choose fewer.
| Scope | Allows |
|---|---|
| `tenants:read` | List and read tenants |
| `tenants:write` | Create, update, suspend, resume, delete and restore tenants, and set tenant spend caps |
| `resources:read` | Read agents, call flows, node flows, knowledge bases, numbers, call history, workflows and recordings in tenants |
| `resources:write` | Create, change and delete those resources |
| `calls:write` | Start outbound calls, web calls and batch calls, and run or activate workflows |
| `numbers:write` | Buy, register and release phone numbers (buying costs money) |
| `events:read` | Read the event log and webhook endpoints |
| `webhooks:write` | Manage webhook endpoints, rotate secrets, send test events and redeliver events |
| `usage:read` | Read usage |
| `templates:read` / `templates:write` | Reserved for [templates](/voice-engine/templates) (planned). No endpoint uses them yet. |
| `sessions:write` | Reserved for [embedding](/voice-engine/embedding) (planned). No endpoint uses it yet. |
### Restricting a key to some tenants
A key can be **restricted to a list of tenants**, for example a key used by one regional team. A restricted key:
- sees only those tenants in lists, usage and the event log;
- gets `404` `tenant_not_found` for any other tenant on `/partner/v1` routes, and `403` `tenant_not_allowed` on standard routes;
- cannot manage webhook endpoints (`403` `key_restricted`), because endpoints receive events for every tenant.
## Calling standard endpoints for a tenant
A partner key can call a set of standard API endpoints on behalf of one of its tenants. Send the tenant ID in `x-workspace-id`:
```bash
curl https://api.trillet.ai/v1/api/agents \
-H "Authorization: Bearer tpk_live_..." \
-H "x-workspace-id: d9d9d9d9d9d9d9d9d9d9d9d9"
```
Access is deny by default. Only the endpoints below are available to partner keys, each with the scope shown. Any other standard endpoint returns `403` `route_not_available`.
### Building an agent
Today a partner builds a tenant's agent through node flows:
1. `POST /v2/api/node-graphs` creates the node flow together with its agent and call flow. The flow starts as a draft. With a partner key, the new agent uses the model `platform-llm` unless the body names another allowed model in `llmModel` (an unknown model returns `400` `LLM_MODEL_INVALID`), and the call flow starts with speech responsiveness 10 and interruption sensitivity 5.5.
2. Edit it with `PUT /v2/api/node-graphs/{id}` or `PATCH /v2/api/node-graphs/{id}/draft`, and check it with `POST /v2/api/node-graphs/{id}/validate`.
3. `POST /v2/api/node-graphs/{id}/publish` makes it live. A flow must be published before it can take calls.
4. `GET /v2/api/node-graphs/{id}` returns the flow with `pathway`, which holds the call flow ID (`pathway._id`) and the agent (`pathway.agent`, whose `_id` is the agent ID).
5. `PUT /v1/api/agents/{agentId}` sets the agent's voice, language, model and other agent settings.
6. `PATCH /partner/v1/tenants/{tenantId}/call-flows/{callFlowId}/settings` sets the greeting, speech timing, recording and call handling timers. See [Call flow settings](/voice-engine/call-flow-settings).
7. `POST /v1/api/agents/{agentId}/bind/{phoneNumberId}` assigns a number. See [Phone numbers](/voice-engine/phone-numbers#assign-a-number-to-an-agent).
Creating and updating simple prompt call flows (`POST` and `PUT /v1/api/call-flows`) is not available to partner keys yet.
### Available endpoints
**Agents**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/agents` | `resources:read` |
| `GET` | `/v1/api/agents/{agentId}` | `resources:read` |
| `GET` | `/v1/api/agents/available` | `resources:read` |
| `POST` | `/v1/api/agents` | `resources:write` |
| `PUT` | `/v1/api/agents/{agentId}` | `resources:write` |
| `DELETE` | `/v1/api/agents/{agentId}` | `resources:write` |
| `POST` | `/v1/api/agents/{agentId}/bind/{phoneNumberId}` | `resources:write` |
| `POST` | `/v1/api/agents/{agentId}/release/{phoneNumberId}` | `resources:write` |
| `GET` | `/v1/api/agents/voices` | `resources:read` |
| `POST` | `/v1/api/agents/voices/search` | `resources:read` |
| `POST` | `/v1/api/agents/voices/preview` | `resources:read` |
| `POST` | `/v1/api/agents/voices/cartesia/preview` | `resources:read` |
**Node flows**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v2/api/node-graphs` | `resources:read` |
| `GET` | `/v2/api/node-graphs/templates` | `resources:read` |
| `GET` | `/v2/api/node-graphs/{id}` | `resources:read` |
| `POST` | `/v2/api/node-graphs` | `resources:write` |
| `PUT` | `/v2/api/node-graphs/{id}` | `resources:write` |
| `PATCH` | `/v2/api/node-graphs/{id}/draft` | `resources:write` |
| `DELETE` | `/v2/api/node-graphs/{id}/draft` | `resources:write` |
| `POST` | `/v2/api/node-graphs/{id}/validate` | `resources:read` |
| `POST` | `/v2/api/node-graphs/{id}/simulate` | `resources:read` |
| `POST` | `/v2/api/node-graphs/{id}/publish` | `resources:write` |
| `POST` | `/v2/api/node-graphs/{id}/apply-live` | `resources:write` |
| `GET` | `/v2/api/node-graphs/{id}/versions` | `resources:read` |
| `POST` | `/v2/api/node-graphs/{id}/versions/{version}/restore` | `resources:write` |
| `GET` | `/v2/api/node-graphs/{id}/runs` | `resources:read` |
| `GET` | `/v2/api/node-graphs/{id}/runs/{runId}` | `resources:read` |
| `POST` | `/v2/api/node-graphs/{id}/test-code` | `resources:write` |
| `POST` | `/v2/api/node-graphs/{id}/duplicate` | `resources:write` |
| `POST` | `/v2/api/node-graphs/{id}/archive` | `resources:write` |
| `DELETE` | `/v2/api/node-graphs/{id}` | `resources:write` |
**Call flows**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/call-flows` | `resources:read` |
| `GET` | `/v1/api/call-flows/{id}` | `resources:read` |
| `GET` | `/v1/api/call-flows/skill-prompt-defaults` | `resources:read` |
| `GET` | `/v2/api/call-flows` | `resources:read` |
| `GET` | `/v2/api/call-flows/metadata` | `resources:read` |
| `GET` | `/v1/api/call-flows/{id}/drafts` | `resources:read` |
| `PATCH` | `/v1/api/call-flows/{id}/drafts/{draftId}` | `resources:write` |
| `POST` | `/v1/api/call-flows/{id}/drafts/{draftId}/activate` | `resources:write` |
| `POST` | `/v1/api/call-flows/{id}/drafts/{draftId}/restore` | `resources:write` |
| `POST` | `/v1/api/call-flows/{id}/drafts/deactivate` | `resources:write` |
| `DELETE` | `/v1/api/call-flows/{id}/drafts/{draftId}` | `resources:write` |
| `PATCH` | `/v1/api/call-flows/{id}/archive` | `resources:write` |
| `PATCH` | `/v1/api/call-flows/{id}/restore` | `resources:write` |
| `DELETE` | `/v1/api/call-flows/{id}` | `resources:write` |
**Knowledge bases**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/knowledgebase` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/paginated` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/limits` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/workspace-usage` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/{id}` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/{id}/text` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/{id}/usage` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/{id}/files/presigned-url` | `resources:read` |
| `GET` | `/v1/api/knowledgebase/{id}/files/proxy` | `resources:read` |
| `POST` | `/v1/api/knowledgebase` | `resources:write` |
| `PUT` | `/v1/api/knowledgebase/{id}` | `resources:write` |
| `POST` | `/v1/api/knowledgebase/{id}/text` | `resources:write` |
| `POST` | `/v1/api/knowledgebase/{id}/files` | `resources:write` |
| `DELETE` | `/v1/api/knowledgebase/knowledgeBases/{knowledgeBaseId}/files/{fileName}` | `resources:write` |
| `DELETE` | `/v1/api/knowledgebase/{id}` | `resources:write` |
**Phone numbers**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/twilio/available-countries` | `resources:read` |
| `GET` | `/v1/api/twilio/available-numbers` | `resources:read` |
| `GET` | `/v1/api/twilio/phone-number-price` | `resources:read` |
| `GET` | `/v1/api/twilio/user-phone-numbers` | `resources:read` |
| `GET` | `/v1/api/twilio/user-phone-number-by-phone-number` | `resources:read` |
| `GET` | `/v1/api/twilio/phone-numbers/{phoneNumberId}/config` | `resources:read` |
| `PUT` | `/v1/api/twilio/phone-numbers/{phoneNumberId}/config` | `resources:write` |
| `PUT` | `/v1/api/twilio/phone-numbers/{phoneNumberId}/config-messages` | `resources:write` |
Buying, registering and releasing numbers use the [Trillet OEM number endpoints](/voice-engine/phone-numbers), not the standard purchase endpoint.
**Calls**
| Method | Path | Scope |
|---|---|---|
| `POST` | `/v1/api/call` | `calls:write` |
| `POST` | `/v1/api/calls/call` | `calls:write` |
| `POST` | `/v1/api/calls/web/connect` | `calls:write` |
| `POST` | `/v1/api/calls/web/disconnect` | `calls:write` |
Use `POST /v1/api/call` for outbound calls. See [Start an outbound call](#start-an-outbound-call).
**Batch calls**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/batch-calls/template` | `resources:read` |
| `POST` | `/v1/api/batch-calls/validate` | `resources:read` |
| `POST` | `/v1/api/batch-calls/preview` | `resources:read` |
| `POST` | `/v1/api/batch-calls/schedule-preview` | `resources:read` |
| `POST` | `/v1/api/batch-calls` | `calls:write` |
| `GET` | `/v1/api/batch-calls/{batchId}` | `resources:read` |
| `GET` | `/v1/api/batch-calls/{batchId}/status` | `resources:read` |
| `GET` | `/v1/api/batch-calls/{batchId}/calls` | `resources:read` |
| `GET` | `/v1/api/batch-calls/{batchId}/calls/{jobId}` | `resources:read` |
| `GET` | `/v1/api/batch-calls/{batchId}/export-results` | `resources:read` |
| `DELETE` | `/v1/api/batch-calls/{batchId}/calls/{jobId}` | `resources:write` |
| `DELETE` | `/v1/api/batch-calls/{batchId}/contacts/{phone}` | `resources:write` |
| `DELETE` | `/v1/api/batch-calls/{batchId}` | `resources:write` |
| `GET` | `/v1/api/batch-history/{batchHistoryId}` | `resources:read` |
| `GET` | `/v1/api/batch-history/batch/{batchId}` | `resources:read` |
| `GET` | `/v1/api/batch-history/workspace/{workspaceId}` | `resources:read` |
**Call history and recordings**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/call-history` | `resources:read` |
| `GET` | `/v2/api/call-history` | `resources:read` |
| `GET` | `/v2/api/call-history/{callHistoryId}` | `resources:read` |
| `GET` | `/v2/api/call-history/resolve/{callId}` | `resources:read` |
| `GET` | `/v2/api/call-history/metrics` | `resources:read` |
| `GET` | `/v2/api/call-history/metrics/daily` | `resources:read` |
| `GET` | `/v2/api/call-history/phonebook` | `resources:read` |
| `GET` | `/v2/api/call-history/filter-options` | `resources:read` |
| `POST` | `/v2/api/call-history/export-csv` | `resources:read` |
| `GET` | `/v2/api/recordings/{callHistoryId}` | `resources:read` |
`GET /v2/api/recordings/{callHistoryId}` returns the audio file for a call in the tenant, or `404` when the call has no recording. `callHistoryId` is the `data.call.id` in [call events](/voice-engine/events#event-shape) and the `callHistoryId` in [per-call usage](/voice-engine/usage-and-billing#per-call). The [recording download](/voice-engine/events#recordings) on Trillet OEM returns the same file.
**Workflows**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v1/api/workflows` | `resources:read` |
| `GET` | `/v1/api/workflows/{id}` | `resources:read` |
| `POST` | `/v1/api/workflows` | `resources:write` |
| `PUT` | `/v1/api/workflows/{id}` | `resources:write` |
| `DELETE` | `/v1/api/workflows/{id}` | `resources:write` |
| `POST` | `/v1/api/workflows/{id}/duplicate` | `resources:write` |
| `POST` | `/v1/api/workflows/{id}/pause` | `resources:write` |
| `POST` | `/v1/api/workflows/{id}/test` | `resources:write` |
| `POST` | `/v1/api/workflows/{id}/activate` | `calls:write` |
| `POST` | `/v1/api/workflows/{id}/run` | `calls:write` |
| `GET` | `/v1/api/workflows/{id}/runs` | `resources:read` |
| `GET` | `/v1/api/workflows/runs/{runId}` | `resources:read` |
| `POST` | `/v1/api/workflows/runs/{runId}/cancel` | `resources:write` |
| `POST` | `/v1/api/workflows/runs/{runId}/retry` | `calls:write` |
| `GET` | `/v1/api/workflows/schedule-preview` | `resources:read` |
| `GET` | `/v1/api/workflows/{id}/webhook-sample` | `resources:read` |
| `GET` | `/v1/api/workflows/phone-numbers` | `resources:read` |
| `GET` | `/v1/api/workflows/pathways` | `resources:read` |
| `GET` | `/v1/api/workflows/{workflowId}/live` | `resources:read` |
**Workspace secrets**
| Method | Path | Scope |
|---|---|---|
| `GET` | `/v2/api/workspaces/secrets` | `resources:read` |
| `POST` | `/v2/api/workspaces/secrets` | `resources:write` |
| `PUT` | `/v2/api/workspaces/secrets/{name}` | `resources:write` |
| `PATCH` | `/v2/api/workspaces/secrets/{name}` | `resources:write` |
| `DELETE` | `/v2/api/workspaces/secrets/{name}` | `resources:write` |
### Not available yet
These return `403` `route_not_available` to a partner key:
- Creating and updating simple prompt call flows (`POST /v1/api/call-flows`, `PUT /v1/api/call-flows/{id}`). Build agents with node flows instead, and change basic settings with [Call flow settings](/voice-engine/call-flow-settings).
- Call-flow draft writes other than those listed above: creating a draft, autosave and publishing a draft (`.../drafts`, `.../drafts/autosave`, `.../drafts/{draftId}/publish`), and every other call-flow route not in the table.
- The `/v1/api/calls/recordings/*` routes. Use `GET /v2/api/recordings/{callHistoryId}` or the [recording download](/voice-engine/events#recordings).
- Routes that take a target workspace in the body, such as duplicating or moving a flow to another workspace, and sharing.
- Routes that take a user ID in the path.
- Third-party credentials: Google, GHL, Meta, bring-your-own voice keys and Google Sheets export.
- Public demo links, Slack and the prompt helper endpoints.
- Account, billing, wallet, team members and roles, domains, and API key management.
### Start an outbound call
`POST /v1/api/call` places an outbound call from one of the tenant's numbers. It needs `calls:write`.
```bash
curl -X POST https://api.trillet.ai/v1/api/call \
-H "Authorization: Bearer tpk_live_..." \
-H "x-workspace-id: d9d9d9d9d9d9d9d9d9d9d9d9" \
-H "Content-Type: application/json" \
-d '{
"to": "+15125550177",
"call_agent_id": "e0e0e0e0e0e0e0e0e0e0e0e0",
"dynamic_variables": { "customer_name": "Sam" },
"metadata": { "crmLeadId": "L-1042" }
}'
```
The number to call, in E.164 format. Anything else returns `400` `INVALID_PHONE_NUMBER`.
The agent to call with. Required unless you send `call_flow_id` instead. The agent's call flow must be live.
A call flow ID, accepted in place of `call_agent_id`. If you send both, they must refer to the same agent, or the request returns `400` `AGENT_FLOW_MISMATCH`.
The tenant number to call from. When omitted, one of the agent's numbers is chosen automatically.
A flat key-value object of variables for the call, for example `{"customer_name": "Sam"}`. Arrays are refused.
Your own data, stored with the call.
A URL to receive webhook events about this call.
`true` refuses the call with `409` `OUTSIDE_CALLING_HOURS` when it is outside the flow's calling hours, instead of queueing it for the next calling window. The `409` response includes `next_available_at` and `timezone`.
A successful request returns `status: "success"` with `call_agent_id`, `callId` (the call history ID), `roomName` and `jobId`. The call is queued and dialled straight after. Refusals return `status: "error"` with `message`, `error` and, where there is one, `code`. A suspended tenant gets `403` `workspace_suspended`.
See [Initiate outbound call](/v1/api-reference/endpoints/calls/initiate-call) for the full reference. `POST /v1/api/calls/call` is an older route that takes only `agentId` and `toNumber`. Use `POST /v1/api/call`, which validates the number and accepts the fields above.
A tenant that is not yours returns `404` `tenant_not_found`, so a key can never confirm another partner's tenant IDs. Your own partner account is not a tenant: a partner key cannot use it as `x-workspace-id`.
The partner key check uses the [Trillet OEM error format](/voice-engine/conventions#errors). Once a request passes the check, the standard endpoint answers in its usual format.
## Authentication errors
| Status | Code | Meaning |
|---|---|---|
| `400` | `conflicting_credentials` | Both a partner key and an `x-api-key` were sent |
| `400` | `tenant_required` | A standard endpoint was called without `x-workspace-id` |
| `400` | `invalid_tenant` | `x-workspace-id` is not a valid tenant ID |
| `401` | `partner_key_required` | A `/partner/v1` route was called with a user session or user API key instead of a partner key |
| `401` | `invalid_api_key` | The key is unknown or revoked |
| `401` | `partner_not_enabled` | Trillet OEM is not enabled for this account |
| `403` | `missing_scope` | The key lacks the scope this endpoint needs |
| `403` | `route_not_available` | The standard endpoint is not available to partner keys |
| `403` | `tenant_not_allowed` | The key is restricted and this tenant is not in its list (standard endpoints) |
| `404` | `tenant_not_found` | The tenant does not exist or is not yours |
| `429` | `rate_limited` | Too many invalid keys from your IP address in the last minute |
Handle a `401` by its status, not only by `error.code`.
---
## Building on Trillet today
*How software partners run Trillet voice agents for their customers with white-label and the standard API, what Trillet OEM adds, and the status of each part.*
Trillet OEM is in early access with design partners. You do not need it to start: partners already run Trillet for their customers with white-label and the standard API. This page explains that setup, what Trillet OEM adds, and what is built today.
## The setup that works today
### 1. An Agency or Enterprise account with white-label
Your account holds your branding: portal domain, logo, colours and email sender. Client workspaces can inherit it, so your customers see your brand, not Trillet's.
### 2. One client workspace per customer
Each of your customers gets its own workspace with its own agents, call flows, numbers, call history and knowledge bases. Create them in the dashboard. Each workspace can draw on your account's wallet or hold its own balance.
### 3. The standard API for everything inside a workspace
Create an API key and send the client workspace ID in `x-workspace-id` to manage that customer's agents, call flows, numbers, calls, batch calls and call history. See [Authentication](/v1/api-reference/authentication).
### 4. Webhooks per call flow
Configure the post-call webhook and the [inbound call webhook](/documentation/inbound-call-webhook) on each call flow to send call results to your system.
```bash
# List one customer's agents, using your API key and that customer's workspace ID
curl https://api.trillet.ai/v1/api/agents \
-H "x-api-key: YOUR_API_KEY" \
-H "x-workspace-id: CLIENT_WORKSPACE_ID"
```
A Business Associate Agreement is available on Agency and Enterprise accounts at no extra fee. Execute it before any customer workspace handles protected health information.
## What Trillet OEM adds
| Today | With Trillet OEM |
|---|---|
| API keys belong to a person and reach every workspace that person can access | [Partner keys](/voice-engine/authentication) belong to your account, with scopes and optional tenant restrictions |
| Client workspaces are created in the dashboard | [Tenants](/voice-engine/tenants) are created, suspended, deleted and restored by API, keyed by your own customer ID, with safe retries |
| Numbers are bought per workspace | [Phone numbers](/voice-engine/phone-numbers) are bought per tenant and billed to your account, or brought over SIP or Twilio |
| Webhooks are set on each call flow | One set of [signed events](/voice-engine/events) for all tenants, with retries, an event log and redelivery |
| Usage is viewed per workspace in the dashboard | A [usage API](/voice-engine/usage-and-billing) per tenant and per call, with monthly spend caps |
| Each customer's agent is configured separately | [Templates](/voice-engine/templates) installed in every tenant and upgraded in staged rollouts (planned) |
| Your users sign in to the Trillet portal (under your brand) | [Embedded screens](/voice-engine/embedding) inside your own app, with no separate login (planned) |
## Release status
| Area | Status |
|---|---|
| Platform groundwork: tenant isolation, suspension that stops traffic, usage recorded per tenant, safe retries, hashed API keys | Built, in early access |
| [Partner keys](/voice-engine/authentication), scopes and tenant restrictions | Built, in early access |
| [Tenants](/voice-engine/tenants): create, update, suspend, resume, delete and restore | Built, in early access |
| [Phone numbers](/voice-engine/phone-numbers): partner-billed purchase, release, and bring your own (SIP or Twilio) | Built, in early access |
| [Call flow settings](/voice-engine/call-flow-settings): greeting, speech, recording and call handling | Built, in early access |
| Node flows created with a partner key start on `platform-llm` with recommended speech settings | Built, in early access |
| [Signed events](/voice-engine/events), event log and redelivery | Built, in early access |
| [Usage and spend caps](/voice-engine/usage-and-billing) | Built, in early access |
| In-call events: `call.started`, `call.transferred`, `call.transfer_failed`, `tool.failed` and `call.blocked` | Built, in early access |
| `sms.*` events | Planned |
| Templates and rollouts | Planned |
| Embedding | Planned |
| Sandbox environment | Planned |
| Partner invoices endpoint | Planned |
| Adopting existing client workspaces as tenants | Planned |
| Version pinning with a `Trillet-Version` request header | Planned |
Pages in this section marked **Early access** describe what is built. Details may still change while it is tested with design partners. Pages marked **Coming soon** describe planned designs. To join early access, contact your Trillet account manager or [talk to us](https://form.typeform.com/to/qRRENIBp).
---
## Trillet OEM call flow settings
*Read and change a Trillet OEM tenant's call flow settings: greeting, speech, recording and call handling.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
The standard call flow create and update endpoints are not available to partner keys. Instead, Trillet OEM has one endpoint for the basic settings of a tenant's call flow: the greeting, speech timing, recording and call handling timers.
The agent's voice, language and model are set on the agent with `PUT /v1/api/agents/{agentId}`, not here. See [Building an agent](/voice-engine/authentication#building-an-agent).
## Endpoints
| Method | Path | Scope |
|---|---|---|
| `GET` | `/partner/v1/tenants/{tenantId}/call-flows/{callFlowId}/settings` | `resources:read` |
| `PATCH` | `/partner/v1/tenants/{tenantId}/call-flows/{callFlowId}/settings` | `resources:write` |
`callFlowId` is the ID of a call flow in the tenant. For a node flow, it is `pathway._id` in the response of `GET /v2/api/node-graphs/{id}`.
## The settings object
```json
{
"object": "call_flow_settings",
"callFlowId": "e1e1e1e1e1e1e1e1e1e1e1e1",
"tenantId": "d9d9d9d9d9d9d9d9d9d9d9d9",
"greeting": {
"inbound": {
"mode": "customMessage",
"text": "Thanks for calling Harbour Dental. How can I help?",
"instructions": null
},
"outbound": {
"mode": "aiFirst",
"text": null,
"instructions": "Introduce yourself and confirm you are speaking with {{customer_name}}."
},
"delaySeconds": 0
},
"speech": {
"responsiveness": 10,
"interruptionSensitivity": 5.5
},
"recording": { "enabled": true },
"callHandling": {
"maxCallDurationSeconds": 1800,
"checkInAfterSeconds": 10,
"checkInAttempts": 1,
"hangUpAfterCheckInSeconds": 10
},
"updatedAt": "2026-11-02T10:40:00.000Z"
}
```
A setting the call flow has never stored is returned as `null`. Values are returned as stored. Older call flows can hold values outside the ranges below, for example a check-in under 5 seconds or a maximum call length of 3600. The ranges apply only to values you change.
| Field | Type | Values |
|---|---|---|
| `greeting.inbound.mode`, `greeting.outbound.mode` | string | `aiFirst` (the agent speaks first, with a greeting it writes), `customMessage` (the agent speaks first with `text`) or `userFirst` (the agent waits for the caller to speak) |
| `greeting.inbound.text`, `greeting.outbound.text` | string | The greeting spoken in `customMessage` mode. Up to 2,000 characters. |
| `greeting.inbound.instructions`, `greeting.outbound.instructions` | string | Instructions for the greeting in `aiFirst` mode. Up to 2,000 characters. |
| `greeting.delaySeconds` | number | Pause before the greeting, 0 to 5 |
| `speech.responsiveness` | number | How quickly the agent replies once the caller stops, 1 to 10 |
| `speech.interruptionSensitivity` | number | How easily the caller can interrupt the agent, 1 to 10 |
| `recording.enabled` | boolean | Record calls on this flow |
| `callHandling.maxCallDurationSeconds` | integer | Longest call allowed, 10 to 1800 |
| `callHandling.checkInAfterSeconds` | integer | Silence before the agent checks the caller is still there: whole seconds from `5` to `30` |
| `callHandling.checkInAttempts` | integer | Check-ins before the agent ends the call: `0` (never), `1`, `2` or `3` |
| `callHandling.hangUpAfterCheckInSeconds` | integer | Wait after the last check-in before hanging up: `10`, `20` or `30` |
Node flows created with a partner key start with `speech.responsiveness` 10 and `speech.interruptionSensitivity` 5.5.
## Read the settings
```bash
curl https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/call-flows/e1e1e1e1e1e1e1e1e1e1e1e1/settings \
-H "Authorization: Bearer tpk_live_..."
```
## Change the settings
Send only the settings you want to change, nested as in the settings object. Everything else is left as it is.
```bash
curl -X PATCH https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/call-flows/e1e1e1e1e1e1e1e1e1e1e1e1/settings \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{
"greeting": {
"inbound": {
"mode": "customMessage",
"text": "Thanks for calling Harbour Dental. How can I help?"
}
},
"recording": { "enabled": true },
"callHandling": { "maxCallDurationSeconds": 900 }
}'
```
Returns the full settings object, plus `activeDraftUpdated` (see [Active drafts](#active-drafts)).
- Values are not converted: `"10"` is refused where a number is expected.
- A field this endpoint does not manage is refused by name with `400` `unknown_setting`, so a setting can never be silently ignored.
- `customMessage` mode needs greeting text, either in the same request or already stored on the flow.
- An `Idempotency-Key` header is optional. When sent, it works as described in [Idempotency](/voice-engine/conventions#idempotency).
The change applies to calls that start after it. Editors open on the flow in the Trillet portal reload it.
## Active drafts
The change is written to the live call flow. If the flow has an active draft, which test calls use, the same settings are copied onto that draft, so a test call hears the change and publishing the draft later does not put the old values back. `activeDraftUpdated` is `true` when a draft was updated.
## Errors
| Status | Code | When |
|---|---|---|
| `400` | `unknown_setting` | A field is not a setting this endpoint can change. `error.param` names it, for example `greeting.inbound.voice`. |
| `400` | `invalid_request` | A value has the wrong type or is out of range, the body is not a JSON object, it contains no settings, or `customMessage` mode has no text. `error.param` names the field when there is one. |
| `404` | `tenant_not_found` | The tenant does not exist, is deleted, is not yours, or the key is restricted to other tenants |
| `404` | `call_flow_not_found` | The call flow does not exist in this tenant |
| `409` | `call_flow_archived` | The call flow is archived and read-only. Restore it with `PATCH /v1/api/call-flows/{id}/restore` first. |
| `409` | `hipaa_recording_conflict` | The call flow is in HIPAA mode, which keeps recording off, and recording would be on after the change: either the request sets `recording.enabled: true`, or the flow still stores recording as on and the request doesn't turn it off. Send `"recording": { "enabled": false }` with your change. `error.param` is `recording.enabled`. |
```json
{
"error": {
"type": "invalid_request_error",
"code": "unknown_setting",
"message": "greeting.inbound.voice is not a setting this endpoint can change.",
"param": "greeting.inbound.voice",
"requestId": "req-1a2b"
}
}
```
---
## Trillet OEM changelog
*Dated changes to Trillet OEM, the white-label voice AI API for EHR vendors, telecom providers and software platforms.*
Changes to the Trillet OEM API and its documentation, newest first. Within `/partner/v1` changes are additive, so existing integrations keep working. The `Trillet-Version` response header carries the date of the release that served each request.
First release to design partners in early access.
**Partner keys**
- [Partner keys](/voice-engine/authentication) (`tpk_live_...`) that belong to your account, not a person, created and revoked in the **OEM API** section of account settings.
- Scopes per key, and optional restriction of a key to some tenants.
- `GET /partner/v1/key` to check a key's scopes and your tenant limit.
- A partner key can call a defined set of standard endpoints inside a tenant, with the tenant ID in `x-workspace-id`: agents, node flows, call flows, knowledge bases, numbers, calls, batch calls, call history, recordings, workflows and secrets.
**Tenants**
- [Create, list, update, suspend, resume, delete and restore](/voice-engine/tenants) a tenant per customer, keyed by your own `externalId`.
- Suspension stops a tenant's outbound calls, SMS and workflow runs, and answers and ends inbound calls, while keeping its configuration and history.
- Deleted tenants can be restored for 30 days.
**Phone numbers**
- [Buy numbers per tenant](/voice-engine/phone-numbers), billed to your partner account at the standard Trillet number price, with monthly renewal.
- Bring your own numbers over a SIP trunk or a Twilio account.
- Release numbers individually, or all at once when a tenant is deleted.
**Agents and call flows**
- Node flows created with a partner key start on the `platform-llm` model and recommended speech settings (responsiveness 10, interruption sensitivity 5.5).
- [Call flow settings](/voice-engine/call-flow-settings): read and change the greeting, speech timing, recording and call handling timers on a tenant's call flow.
**Events**
- [Signed webhooks](/voice-engine/events) in the Standard Webhooks format, for all tenants, with retries for about 22 hours, an event log kept for 30 days, and redelivery.
- Call events: `call.started`, `call.ended`, `call.analyzed`, `call.no_answer`, `call.failed` and `call.blocked`, with conversation data on by default and optional PII redaction.
- In-call events: `call.transferred`, `call.transfer_failed` and `tool.failed`.
- Booking, recording, workflow run, number, tenant and usage events.
- Recording download for a tenant's call.
**Usage and spend caps**
- [Usage](/voice-engine/usage-and-billing) totals by day or month, per tenant or per charge type, and one row per call charge.
- Monthly spend caps per tenant, with alerts at 80% and 100%. Inbound calls continue at the cap.
**Conventions**
- `Idempotency-Key` on tenant creation and number purchase and registration, so retries never create anything twice.
- One error format with stable `code` values, cursor pagination and the `Trillet-Version` response header.
**Documentation**
- A [quickstart](/voice-engine/quickstart) from partner key to first phone call, with curl, Node.js and Python.
- An [OpenAPI 3.1 specification](https://raw.githubusercontent.com/TrilletAI/trillet-ai-docs/main/public/openapi/trillet-oem.json) and a generated [API reference](/voice-engine/api-reference/create-a-tenant).
---
## Compliance and data
*HIPAA, data residency, what data events carry, and retention for Trillet OEM partners.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
## HIPAA
Trillet supports HIPAA workloads. See our [Terms of Use](https://trillet.ai/terms-of-use).
A call flow in HIPAA mode keeps call recording off. [Call flow settings](/voice-engine/call-flow-settings) refuses `recording.enabled: true` on such a flow with `409` `hipaa_recording_conflict`.
## Data residency
Each tenant is created in a region, `us` or `au`. Its call records, transcripts and recordings are stored in that region. Events are stored in the tenant's region too, and hold references rather than transcripts: webhook payloads are built from the tenant's regional data when they are delivered.
## Data in events
Call events include transcripts, summaries, extracted data and variables by default. For each webhook endpoint you can:
- turn conversation data off (`includeConversationData: false`), or
- keep it and mask emails, phone numbers and card-like numbers (`redactPII: true`). Masking is pattern based and best effort.
Recordings are never included in payloads. A payload carries a link to the recording download endpoint, which needs a partner key with `resources:read`. See [Events](/voice-engine/events#conversation-data).
The event log keeps events for 30 days.
## Isolation
- Each tenant is a separate workspace. A partner key can reach only its own tenants, and a key can be restricted further to a list of tenants.
- Requests naming another partner's tenant return `404`.
- Partner keys are stored as hashes. Webhook signing secrets are stored encrypted.
- Tenant lifecycle changes (create, update, suspend, resume, delete, restore) and phone number purchases, registrations and releases made through Trillet OEM are written to the tenant's audit log with the ID of the key that made them.
## Branding
When your account has white-label enabled, new tenants inherit your branding: company name, logo, colours and theme. Webhook requests are sent from Trillet to your servers and identify Trillet (for example in the `User-Agent` header); your customers do not see them.
---
## API conventions
*Idempotency, errors, pagination and versioning for Trillet OEM.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
- **Base URL:** `https://api.trillet.ai/partner/v1`
- **Format:** JSON request and response bodies, UTF-8. Timestamps are ISO 8601 UTC, except `created` on events, which is Unix seconds.
- **IDs:** Tenant, number, call flow, endpoint and key IDs are 24-character hexadecimal strings. Event IDs start with `evt_`. Store all IDs as strings.
- **Objects:** Every response object has an `object` field, for example `tenant`, `phone_number`, `call_flow_settings`, `event` or `list`.
## Idempotency
Networks fail. Endpoints that create something billable or hard to undo require an `Idempotency-Key` header, so a retry never creates it twice. On the call flow settings endpoint the header is optional. Other `/partner/v1` endpoints ignore it.
| Endpoint | `Idempotency-Key` |
|---|---|
| `POST /partner/v1/tenants` | Required |
| `POST /partner/v1/tenants/{tenantId}/numbers` | Required |
| `POST /partner/v1/tenants/{tenantId}/numbers/external` | Required |
| `PATCH /partner/v1/tenants/{tenantId}/call-flows/{callFlowId}/settings` | Optional |
```bash
curl -X POST https://api.trillet.ai/partner/v1/tenants \
-H "Authorization: Bearer tpk_live_..." \
-H "Idempotency-Key: create-tenant-cust_8842" \
-H "Content-Type: application/json" \
-d '{ "externalId": "cust_8842", "name": "Harbour Dental" }'
```
| Situation | Result |
|---|---|
| First request with a key | Runs normally. The response is stored for 24 hours. |
| Retry with the same key and the same request | The stored response is returned with the header `Idempotent-Replayed: true`. Nothing runs twice. |
| Same key, different request | `422` `idempotency_key_reused` |
| Same key while the first request is still running | `409` `idempotency_key_in_use`. Retry after `Retry-After`. |
| No key on an endpoint that requires one | `400` `idempotency_key_required` |
| The first request failed with a `5xx`, `401`, `403`, `409` or `429` | Not stored. A retry runs again. |
| The first request failed with any other `4xx`, for example `402` `insufficient_funds`, `400` `number_purchase_failed` or `404` | Stored and replayed for 24 hours like a success. After you fix the cause (add funds, add the regulatory bundle, correct the field), retry with a **new** key. A body that fails the endpoint's schema is refused before the key is checked, so that `400` is not stored. |
- Keys are 1 to 255 printable ASCII characters, with no spaces, and are scoped to your partner account. A UUID, or your own operation ID, works well. A key that does not fit returns `400` `idempotency_key_invalid`.
- "The same request" means the same method, path, query string and JSON body. Key order in the body does not matter.
- If a request is interrupted before it finishes, the key is locked for up to 2 minutes, after which a retry can run.
Idempotency errors have `type: "idempotency_error"` and no `requestId`.
## Errors
Every other error has the same shape:
```json
{
"error": {
"type": "conflict_error",
"code": "tenant_deleted_restorable",
"message": "A deleted tenant d9d9d9d9d9d9d9d9d9d9d9d9 has this externalId. Restore it, or use a different externalId.",
"requestId": "req-1a2b"
}
}
```
`param` is included when the error is about one request field, for example a body field that failed validation. Handle errors by `code`, not by `message`. Include `requestId` when you contact support.
| Status | `type` | Meaning |
|---|---|---|
| `400` | `invalid_request_error` | The request is malformed or a field is invalid (`invalid_request`, or a specific code such as `invalid_external_id`) |
| `401` | `authentication_error` | Authentication failed. See [Authentication](/voice-engine/authentication#authentication-errors). |
| `402` | `invalid_request_error` | `insufficient_funds`: your account cannot pay for a number purchase |
| `403` | `permission_error` | The key is not allowed to do this |
| `404` | `invalid_request_error` | Not found, or not yours |
| `409` | `conflict_error` | Conflict, for example a duplicate `externalId` or a tenant limit |
| `410` | `invalid_request_error` | `restore_window_expired`: a tenant deleted more than 30 days ago |
| `429` | `rate_limit_error` | Rate limited |
| `500` | `api_error` | A problem on our side. Safe to retry with the same `Idempotency-Key`. |
Each page lists the codes its endpoints return.
## Pagination
List endpoints return a page, newest first:
```json
{
"object": "list",
"data": [ { "object": "tenant", "id": "d9d9d9d9d9d9d9d9d9d9d9d9" } ],
"hasMore": true
}
```
To get the next page, pass the `id` of the last item as `starting_after`, with an optional `limit`:
```bash
curl "https://api.trillet.ai/partner/v1/tenants?limit=50&starting_after=d9d9d9d9d9d9d9d9d9d9d9d9" \
-H "Authorization: Bearer tpk_live_..."
```
| List | `limit` |
|---|---|
| `GET /tenants` | 1 to 100, default 20 |
| `GET /events` | 1 to 100, default 20 |
| `GET /usage/calls` | 1 to 200, default 50 |
`GET /tenants/{tenantId}/numbers` and `GET /webhook-endpoints` return every item in one page.
## Versioning
The major version is in the path (`/partner/v1`). Within a version we only add things: new endpoints, new optional fields, new event types. Your code should ignore fields and event types it does not recognise.
Every response carries a `Trillet-Version` header with the date of the API release that served it, for example `Trillet-Version: 2026-10-28`. It is informational: requests cannot pin a version yet. Version pinning by request header is planned.
## Rate limits
During early access there is no published per-key request limit. Repeated invalid keys from one IP address (20 in a minute) are refused with `429` `rate_limited` for the rest of that minute. Tell your account manager about expected volumes before large provisioning runs.
---
## Embedding
*Show Trillet OEM screens inside your app, signed in as your user, with no Trillet login.*
**Coming soon.** This part of Trillet OEM is planned and not built yet. This page describes the planned design; details may change before release. The rest of Trillet OEM is in early access.
You can build your whole experience on the API. If you would rather not rebuild screens such as call history or the flow editor, you can embed them in your app instead.
## How it works
### 1. Your backend creates a session
When your user opens the screen, your server creates an embed session for that tenant and user with a partner key.
### 2. Your frontend loads the URL
Put the returned one-time URL in an iframe. It signs the user in for that tenant only.
### 3. The session expires
Sessions last up to one hour. Create a new one when the user returns.
```bash
curl -X POST https://api.trillet.ai/partner/v1/sessions \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{
"tenantId": "6a9622d2c1e8f3a4b5d6e7f8",
"user": { "externalId": "usr_551", "name": "Dana Lee", "role": "editor" },
"screens": ["call-history", "call-flow-editor"],
"ttlSeconds": 3600
}'
```
```json
{ "url": "https://app.trillet.ai/embed/s/2Zk9...", "expiresAt": "2026-11-02T16:04:11Z" }
```
```html
```
## Roles and screens
| Role | Can |
|---|---|
| `viewer` | See the allowed screens |
| `editor` | Also change agents, flows and settings on those screens |
| `admin` | Also manage numbers and integrations on those screens |
`screens` limits what the session can open, and the limit is enforced on the server, not just hidden in the interface. An embed session can never reach billing, team members, keys, or any other tenant.
## Setup
- Add the origins that will host the iframe (for example `https://app.example.com`) in your partner settings. Other sites cannot frame the screens.
- Embedded screens use your branding and show no Trillet account menus.
- Your users are identified by your `externalId`. They do not receive Trillet emails and do not count as Trillet seats.
---
## Events and webhooks
*Trillet OEM signed webhooks for what happens across your tenants, with retries, an event log and redelivery.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
Register webhook endpoints on your partner account. Each endpoint receives the event types it subscribes to, from all of your tenants, signed with the [Standard Webhooks](https://www.standardwebhooks.com) format so you can verify they came from Trillet.
## Endpoints
| Method | Path | Scope |
|---|---|---|
| `POST` | `/partner/v1/webhook-endpoints` | `webhooks:write` |
| `GET` | `/partner/v1/webhook-endpoints` | `events:read` |
| `GET` | `/partner/v1/webhook-endpoints/{id}` | `events:read` |
| `PATCH` | `/partner/v1/webhook-endpoints/{id}` | `webhooks:write` |
| `DELETE` | `/partner/v1/webhook-endpoints/{id}` | `webhooks:write` |
| `POST` | `/partner/v1/webhook-endpoints/{id}/rotate-secret` | `webhooks:write` |
| `POST` | `/partner/v1/webhook-endpoints/{id}/test` | `webhooks:write` |
| `GET` | `/partner/v1/events` | `events:read` |
| `GET` | `/partner/v1/events/{eventId}` | `events:read` |
| `POST` | `/partner/v1/events/{eventId}/redeliver` | `webhooks:write` |
| `GET` | `/partner/v1/tenants/{tenantId}/calls/{callId}/recording` | `resources:read` |
Webhook endpoint routes need a key that is not [restricted to some tenants](/voice-engine/authentication#restricting-a-key-to-some-tenants), because an endpoint receives events for every tenant.
## Add an endpoint
```bash
curl -X POST https://api.trillet.ai/partner/v1/webhook-endpoints \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.example.com/trillet/events",
"description": "Production",
"enabledEvents": ["call.ended", "call.analyzed", "booking.created"]
}'
```
A public `https` URL on the default port 443. No credentials or fragment in the URL.
Up to 200 characters.
Event types to send, or `["*"]` for all (the default). Up to 50 entries.
Whether call payloads include the summary, extracted data, variables, booking and transcript. `null` (the default) uses your account setting, which is on unless Trillet has turned it off for you.
Mask emails, phone numbers and card-like numbers in conversation data. Default `false`.
The response is `201` with the endpoint plus its signing `secret` (`whsec_...`). The secret is returned only here and on rotation, so store it.
```json
{
"object": "webhook_endpoint",
"id": "e4e4e4e4e4e4e4e4e4e4e4e4",
"url": "https://api.example.com/trillet/events",
"description": "Production",
"enabledEvents": ["call.ended", "call.analyzed", "booking.created"],
"status": "enabled",
"disabledReason": null,
"failingSince": null,
"includeConversationData": null,
"redactPII": false,
"createdAt": "2026-11-02T10:30:00.000Z",
"secret": "whsec_..."
}
```
An account can have up to 10 endpoints (`409` `too_many_endpoints`). An invalid URL returns `400` `invalid_url`, and an unknown event type `400` `invalid_events`. An endpoint ID that is not yours returns `404` `endpoint_not_found`. `DELETE` returns `{ "object": "webhook_endpoint", "id": "...", "deleted": true }`.
`PATCH` accepts the same fields plus `status` (`enabled` or `disabled`). Setting `status: "enabled"` re-enables an endpoint that was disabled after failing.
`POST /webhook-endpoints/{id}/test` sends an `endpoint.test` event to that endpoint only and returns `202` with the event ID. The endpoint must be enabled (`409` `endpoint_disabled` otherwise) and subscribed to `endpoint.test` or `*` (`409` `endpoint_not_subscribed` otherwise).
## Event shape
```json
{
"id": "evt_e6e6e6e6e6e6e6e6e6e6e6e6",
"type": "call.ended",
"created": 1762095851,
"livemode": true,
"tenant": { "id": "d9d9d9d9d9d9d9d9d9d9d9d9", "externalId": "cust_8842" },
"data": {
"call": {
"id": "e5e5e5e5e5e5e5e5e5e5e5e5",
"direction": "inbound",
"channel": "phone",
"status": "completed",
"from": "+15125550177",
"to": "+15125550142",
"agentId": "e0e0e0e0e0e0e0e0e0e0e0e0",
"callFlowId": "e1e1e1e1e1e1e1e1e1e1e1e1",
"startedAt": "2026-11-02T15:01:40.000Z",
"endedAt": "2026-11-02T15:04:11.000Z",
"durationSeconds": 151,
"endReason": "user_hangup",
"endedBy": "user",
"cost": 0.38,
"batchId": null,
"recording": {
"available": true,
"url": "https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/calls/e5e5e5e5e5e5e5e5e5e5e5e5/recording"
},
"summary": "Caller booked a cleaning for Thursday 3pm.",
"extractedData": { "appointment_type": "cleaning" },
"variables": { "customer_name": "Sam" },
"booking": { "booked": true },
"transcript": [
{ "role": "assistant", "text": "Harbour Dental, how can I help?", "at": "2026-11-02T15:01:41.000Z" }
]
}
}
}
```
| Field | Notes |
|---|---|
| `id` | Event ID. Also sent in the `webhook-id` header. Use it to de-duplicate. |
| `type` | The event type |
| `created` | When the event happened, in Unix seconds |
| `livemode` | Always `true` until sandbox tenants are available |
| `tenant` | The tenant's `id` and `externalId`. `null` for account-level events. |
| `data` | Depends on the type. Call events carry `data.call`. |
Call payloads are built when each delivery is sent, from the tenant's region, so a redelivery shows the call record as it is at that time. `data.call.id` is the call history ID: use it with `GET /v2/api/call-history/{callHistoryId}`, `GET /v2/api/recordings/{callHistoryId}` and to match `callHistoryId` in [per-call usage](/voice-engine/usage-and-billing#per-call). Values in `data.call` can be `null` when the call did not record them. `direction` is `inbound`, `outbound` or `web`; `channel` is `phone`, `whatsapp` or `web`; `status` is `completed`, `pending`, `failed` or `blocked`. `endReason` and `endedBy` are descriptive text, not a fixed list. `cost` is the call charge in USD. The conversation fields (`summary`, `extractedData`, `variables`, `booking`, `transcript`) are omitted when conversation data is off for the endpoint.
## Event types
### Sent today
Events sent during a call, as it happens:
| Type | When | `data` |
|---|---|---|
| `call.started` | A call is connected to an agent and its call record is active | `call`, `direction`, `callType` |
| `call.transferred` | A transfer to a person or another number connected | `call`, `team`, `target`, `mode` |
| `call.transfer_failed` | A transfer attempt failed. Sent once per attempt. | `call`, `team`, `target`, `mode`, `reason` |
| `tool.failed` | A custom tool or API call during a call failed or returned an HTTP error. At most 5 per call. | `call`, `tool`, `kind`, `status` (HTTP status, when there is one), `error` |
| `call.blocked` | A call was refused before reaching the agent: the tenant is suspended, an inbound calling rule matched, or there is not enough balance | `call`, `reason`, `rule`, `direction` (`inbound` or `outbound/webcall`) |
Events sent after a call's post-call processing finishes, not at the moment it ends:
| Type | When | `data` |
|---|---|---|
| `call.ended` | A call ended normally | `call` |
| `call.no_answer` | An outbound call was not answered, was busy, or reached voicemail | `call` |
| `call.failed` | A call failed | `call` |
| `call.blocked` | A call record finished with status `blocked` | `call` |
| `call.analyzed` | The call has a summary or extracted data | `call` |
| `booking.created`, `booking.rescheduled`, `booking.cancelled` | The call created, moved or cancelled an appointment | `call` |
| `recording.available` | The call has a recording | `call` |
Other events:
| Type | When | `data` |
|---|---|---|
| `workflow_run.completed`, `workflow_run.failed` | A workflow run finished | `error` (failed runs only). The payload does not include the workflow ID or run ID. |
| `number.provisioned` | A number was bought or registered | `phoneNumber`, `provider` |
| `number.released` | A number was released, either directly or because its tenant was deleted | `phoneNumber`. A direct release also has `provider` (currently `null`); a tenant delete has `reason: "tenant_deleted"` instead. |
| `number.renewal_failed` | A monthly number charge failed | `phoneNumber`, `amount` |
| `tenant.created` | A tenant was created | `externalId` |
| `tenant.updated` | A tenant's name, metadata or spend cap changed | none |
| `tenant.suspended` | A tenant was suspended | `reason`, if given |
| `tenant.resumed`, `tenant.deleted`, `tenant.restored` | Tenant lifecycle | none |
| `usage.threshold_reached` | A spend cap reached 80% or 100% this month. See [Spend caps](/voice-engine/usage-and-billing#spend-caps). | `scope`, `percent`, `cap`, `monthToDate`, `month` |
| `endpoint.test` | You sent a test event | `message` |
Notes on the in-call events:
- `data.call` is the call record at delivery time. It can be `null`, for example for a call refused for insufficient balance, which has no call record.
- `target` is masked: only the last 4 digits of a phone number or SIP user are shown.
- `tool.failed` does not forward the third-party response body. `error` is a short error message of up to 300 characters. `kind` is `custom_tool` or `api` when known.
- `reason` on `call.blocked` is a short code such as `workspace_suspended`, `insufficient_balance` or `inbound_rule`. `rule` is the name of the matched inbound rule, when there is one.
- `call.blocked` is listed in both tables: one is sent at the moment of refusal, the other when a blocked call record finishes post-call processing. The same call can produce both, so de-duplicate on `data.call.id` as well as the event `id`.
### Coming soon
These types are accepted in `enabledEvents` but are not sent yet:
| Type | When |
|---|---|
| `sms.received`, `sms.sent`, `sms.failed` | Text messages |
Template rollout events are planned with [templates](/voice-engine/templates). New event types may be added at any time. Ignore types you do not handle.
## Conversation data
Transcripts, summaries, extracted data, dynamic variables and booking details are included in call payloads by default.
- Set `includeConversationData: false` on an endpoint to leave them out. Call metadata (numbers, times, duration, status, cost, recording link) is still sent.
- Set `redactPII: true` to keep them but mask email addresses as `[email]`, phone numbers as `[phone]` and card-like numbers as `[number]` in the summary, extracted data, variables and transcript. Masking is pattern based and best effort. IDs, times and URLs are not masked. The top-level `from` and `to` numbers are not masked.
## Recordings
Recordings are never included in a payload. When a call has one, `data.call.recording.url` points at the recording download endpoint. Fetch it with a partner key that has `resources:read`:
```bash
curl -L -o call.mp3 \
"https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/calls/e5e5e5e5e5e5e5e5e5e5e5e5/recording" \
-H "Authorization: Bearer tpk_live_..."
```
The response is the audio file. A call with no recording returns `404` `recording_not_found`.
## Verifying signatures
Each delivery is a `POST` with a JSON body and three headers:
- `webhook-id`: the event ID, the same as `id` in the body
- `webhook-timestamp`: when this delivery attempt was signed, in Unix seconds
- `webhook-signature`: `v1,` of `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64-decoded part of your secret after `whsec_`. During a secret rotation there are two signatures, separated by a space.
Any Standard Webhooks library verifies this for you. Verify against the raw request body, before any JSON parsing, and reject timestamps more than 5 minutes old.
### Node.js
```js
// npm install standardwebhooks express
import express from 'express';
import { Webhook } from 'standardwebhooks';
const app = express();
const wh = new Webhook(process.env.TRILLET_WEBHOOK_SECRET); // whsec_...
app.post('/trillet/events', express.raw({ type: 'application/json' }), (req, res) => {
let event;
try {
event = wh.verify(req.body.toString('utf8'), {
'webhook-id': req.header('webhook-id'),
'webhook-timestamp': req.header('webhook-timestamp'),
'webhook-signature': req.header('webhook-signature'),
});
} catch {
return res.status(400).send('invalid signature');
}
res.sendStatus(204); // respond first, then do the work
handle(event); // de-duplicate on event.id
});
```
### Python
```python
# pip install standardwebhooks flask
import os
from flask import Flask, request
from standardwebhooks.webhooks import Webhook
app = Flask(__name__)
wh = Webhook(os.environ["TRILLET_WEBHOOK_SECRET"]) # whsec_...
@app.post("/trillet/events")
def events():
try:
event = wh.verify(request.get_data(), {
"webhook-id": request.headers["webhook-id"],
"webhook-timestamp": request.headers["webhook-timestamp"],
"webhook-signature": request.headers["webhook-signature"],
})
except Exception:
return "invalid signature", 400
handle(event) # de-duplicate on event["id"]; queue slow work
return "", 204
```
### Node.js (no library)
```js
import crypto from 'node:crypto';
export function verifyTrilletEvent(rawBody, headers, secret) {
const id = headers['webhook-id'];
const timestamp = headers['webhook-timestamp'];
const signatures = headers['webhook-signature'] || '';
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ''), 'base64');
const expected = crypto
.createHmac('sha256', key)
.update(`${id}.${timestamp}.${rawBody}`)
.digest('base64');
return signatures.split(' ').some((entry) => {
const [version, signature] = entry.split(',');
return (
version === 'v1' &&
signature.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
);
});
}
```
### Rotating a secret
`POST /webhook-endpoints/{id}/rotate-secret` returns a new `secret`. The previous secret keeps signing alongside the new one for 24 hours (`previousSecretExpiresAt`), so you can deploy the new secret without missing events.
## Delivery and retries
- Respond with any `2xx` within 10 seconds. Do slow work after responding. Redirects are not followed.
- A failed delivery is retried up to 9 times, after 10 seconds, 1 minute, 5 minutes, 30 minutes, 1 hour, 2 hours, 4 hours, 6 hours and 8 hours: about 22 hours in all.
- Events can arrive more than once and out of order. De-duplicate on `id` and use `created` for ordering.
- An endpoint that keeps failing for 3 days is disabled, and the owner of your partner account is emailed. Events raised while it is disabled are still recorded in the event log. Fix the endpoint, re-enable it with `PATCH`, then redeliver what you missed.
## Event log and redelivery
The event log keeps events for 30 days. It records an event when at least one of your endpoints subscribes to its type.
```bash
curl "https://api.trillet.ai/partner/v1/events?type=call.ended&tenantId=d9d9d9d9d9d9d9d9d9d9d9d9&since=1762041600&limit=50" \
-H "Authorization: Bearer tpk_live_..."
```
`GET /events` accepts `type`, `tenantId`, `since` (Unix seconds), `limit` and `starting_after`. Each entry shows the delivery status per endpoint:
```json
{
"object": "event",
"id": "evt_e6e6e6e6e6e6e6e6e6e6e6e6",
"type": "call.ended",
"tenantId": "d9d9d9d9d9d9d9d9d9d9d9d9",
"data": {},
"created": 1762095851,
"deliveries": [
{
"endpointId": "e4e4e4e4e4e4e4e4e4e4e4e4",
"status": "failed",
"attempts": 10,
"lastAttemptAt": "2026-11-03T13:05:00.000Z",
"lastStatusCode": 503,
"lastError": "HTTP 503"
}
]
}
```
In the list, `data` holds only the facts stored with the event. `GET /events/{eventId}` returns one event and, for call events, renders `data.call` as a delivery would, using your account's conversation data setting. It does not apply an endpoint's `redactPII`. An unknown event ID returns `404` `event_not_found`.
To send an event again:
```bash
curl -X POST https://api.trillet.ai/partner/v1/events/evt_e6e6e6e6e6e6e6e6e6e6e6e6/redeliver \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{ "endpointId": "e4e4e4e4e4e4e4e4e4e4e4e4" }'
```
With `endpointId`, the event is sent to that endpoint even if it is not subscribed to the event's type. Without `endpointId`, the event is sent to every enabled endpoint subscribed to its type. Returns `202` with the number of endpoints it is being sent to. With no enabled endpoint to send to, it returns `409` `no_enabled_endpoint`. Redelivery needs `webhooks:write`. Unlike managing endpoints, it also works with a key restricted to some tenants, for those tenants' events.
---
## Trillet OEM: white-label voice AI API for EHR vendors, telecom providers and software platforms
*Trillet OEM is a white-label voice AI API for EHR and practice-management vendors, telecommunications providers and software platforms. One integration gives each of your clients a voice agent and a phone line, under your brand, billed to your account.*
Trillet OEM is a white-label voice AI API for platforms that serve many businesses: EHR and practice-management vendors, telecommunications providers, and software companies with hundreds, thousands or tens of thousands of clients. With one integration you can offer every one of your clients a voice agent and a phone line out of the box, under your own brand, billed to your account. Your product stays the experience your clients know. Trillet runs the telephony, the real-time voice pipeline, the agents and the call data underneath it.
## What you get
- **A workspace per client.** Each client is a tenant with its own agents, numbers, call history and usage, created and managed by API with your own customer ID.
- **Voice agents and phone numbers.** Inbound and outbound calling, numbers bought per tenant or brought over SIP, and agents built from node flows.
- **Signed events and usage.** One webhook stream for all of your tenants, usage per tenant and per call, and monthly spend caps.
- **We build it with you.** Partners work with the Trillet solutions team and have direct access to our engineers to design, launch and grow their voice offering.
## How it works
### 1. Partner key
Your backend authenticates with a partner key that belongs to your account. See [Authentication](/voice-engine/authentication).
### 2. A tenant per client
Create a [tenant](/voice-engine/tenants) for each client, keyed by your own customer ID. Your clients never need a Trillet login.
### 3. Agents and numbers
Build the client's agent and give it a [phone number](/voice-engine/phone-numbers), using the same key with the tenant ID in `x-workspace-id`.
### 4. Signed events
Receive [events](/voice-engine/events) for calls, bookings, numbers and tenants from every tenant at one endpoint.
### 5. Usage
Read [usage](/voice-engine/usage-and-billing) per tenant and per call, and cap each tenant's monthly spend.
Your first tenant, agent and phone call in five steps, in curl, Node.js and Python.
The Trillet OEM API as OpenAPI 3.1, with a generated [API reference](/voice-engine/api-reference/create-a-tenant).
## Pricing
Trillet OEM partners pay the same standard rates as every Trillet customer, billed to the partner account: calls start at $0.12 per minute and phone numbers start at $4.99 per month. What you charge your own clients is up to you.
## Early access
Trillet OEM is in early access with design partners. Contact your Trillet account manager or [talk to us](https://form.typeform.com/to/qRRENIBp) to join. Design partners work directly with our solutions team and engineers. Details of the API may still change before general release.
Partners also run Trillet for their clients today with white-label and the standard API. See [Building on Trillet today](/voice-engine/available-today) for that setup and the status of each part of Trillet OEM.
## Building blocks
Create, suspend, delete and restore a workspace per customer, keyed by your own customer ID.
Buy numbers per tenant, or bring your own Twilio account or SIP carrier.
Signed webhooks for calls, bookings, workflows, numbers, tenants and spend caps.
Usage per tenant and per call, with monthly spend caps.
Design an agent once, install it for every tenant, and roll out new versions in stages.
Show call history or the flow editor inside your app, signed in as your user.
## Trillet OEM or the standard API?
| You want to | Use |
|---|---|
| Run agents for your own business | The [standard API](/v1/api-reference/introduction) with your workspace API key |
| Manage a handful of client workspaces by hand | The Trillet dashboard (Agency plan) |
| Provision and run agents for many customers from your own product | Trillet OEM |
Trillet OEM does not replace the standard API. A partner key can call a defined set of standard endpoints (agents, node flows, call flows, knowledge bases, numbers, calls, batch calls, call history, recordings, workflows and secrets) on behalf of any of its tenants. See [Authentication](/voice-engine/authentication#calling-standard-endpoints-for-a-tenant) for the list. Trillet OEM adds what a platform needs on top: tenant lifecycle, partner-billed numbers, [call flow settings](/voice-engine/call-flow-settings), partner-level events and usage.
## Regions
Each tenant is created in a region, `us` or `au`. Its calls, transcripts and recordings are stored in that region.
A separate sandbox environment is planned. Today, use a dedicated tenant for development and testing.
## Next steps
### 1. Run the quickstart
Follow the [quickstart](/voice-engine/quickstart) to create a tenant, an agent and a number, and place a call.
### 2. Read the concepts
[Authentication](/voice-engine/authentication) and [API conventions](/voice-engine/conventions) cover keys, scopes, idempotency, errors and pagination.
### 3. Plan your tenant model
Decide which of your customer IDs becomes each tenant's `externalId`. See [Tenants](/voice-engine/tenants).
### 4. Plan your event handling
Most integrations start from `call.ended` and `call.analyzed`. See [Events](/voice-engine/events).
---
## Trillet OEM phone numbers
*Buy phone numbers for each Trillet OEM tenant, billed to your partner account, or bring your own Twilio account or SIP carrier.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
Each tenant needs at least one number for phone calls. You can buy numbers through Trillet, bring your own, or mix both across tenants.
## Endpoints
| Method | Path | Scope |
|---|---|---|
| `GET` | `/partner/v1/tenants/{tenantId}/numbers` | `resources:read` |
| `GET` | `/partner/v1/tenants/{tenantId}/numbers/{numberId}` | `resources:read` |
| `POST` | `/partner/v1/tenants/{tenantId}/numbers` | `numbers:write` |
| `POST` | `/partner/v1/tenants/{tenantId}/numbers/external` | `numbers:write` |
| `DELETE` | `/partner/v1/tenants/{tenantId}/numbers/{numberId}` | `numbers:write` |
## The phone number object
```json
{
"object": "phone_number",
"id": "e3e3e3e3e3e3e3e3e3e3e3e3",
"tenantId": "d9d9d9d9d9d9d9d9d9d9d9d9",
"phoneNumber": "+15125550142",
"provider": "telnyx",
"type": "local",
"external": false,
"status": "active",
"agentId": null,
"callFlowId": null,
"billing": {
"monthlyPrice": 4.99,
"nextChargeAt": "2026-12-02T10:20:00.000Z",
"status": "active"
},
"createdAt": "2026-11-02T10:20:00.000Z"
}
```
`billing` is present for numbers bought through Trillet OEM and `null` for your own numbers. `billing.monthlyPrice` is the monthly price in USD, `billing.nextChargeAt` is when the next month is charged, and `billing.status` is `active` or `past_due`.
`GET /numbers/{numberId}` for a number that is not in the tenant returns `404` `number_not_found`.
## Buy a number
Find a number with the standard [available numbers](/v1/api-reference/endpoints/phone-numbers/available-numbers) endpoint, sending the tenant ID in `x-workspace-id`. Then buy it through Trillet OEM, so it is billed to your partner account instead of a card:
```bash
curl -X POST https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/numbers \
-H "Authorization: Bearer tpk_live_..." \
-H "Idempotency-Key: number-cust_8842-1" \
-H "Content-Type: application/json" \
-d '{ "phoneNumber": "+15125550142", "country": "US", "type": "local" }'
```
The number in E.164 format.
Two-letter country code.
`local` (default) or `mobile`.
Regulatory address, for countries that need one.
Regulatory bundle, for countries that need one.
Returns `201` with the number. `Idempotency-Key` is required.
- Each number costs $4.99 per month, whatever its country and type, unless Trillet has agreed a different number price for your account. The price is fixed on the number when you buy it. A change to your account's agreed price applies from each number's next renewal.
- The first month is charged to your account when you buy. After that each number renews monthly on the date it was bought. Renewals are processed daily.
- The `402` below is a check made before the purchase. If the first month's charge then fails after the carrier has sold you the number, the request still returns `201`, with `billing.status: "past_due"`. Check `billing.status` on the response.
- If a charge cannot be taken, the number keeps working, `billing.status` becomes `past_due`, and the charge is retried daily. Each failed renewal attempt sends a `number.renewal_failed` event, so you get one a day while the number stays past due. Releasing the number is your decision.
- Number charges appear in [usage](/voice-engine/usage-and-billing) as `phone_number_charge`.
| Status | Code | When |
|---|---|---|
| `402` | `insufficient_funds` | Your account cannot pay for the first month, or a [spend cap](/voice-engine/usage-and-billing#spend-caps) has been reached |
| `409` | `tenant_suspended` | Resume the tenant first |
| `400` | `number_purchase_failed` | The carrier refused the purchase, for example the number is taken or a regulatory bundle is needed. The message has the reason. |
## Bring your own numbers
Register a number you or your customer already own. Trillet does not bill these numbers.
### SIP trunk
```bash
curl -X POST https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/numbers/external \
-H "Authorization: Bearer tpk_live_..." \
-H "Idempotency-Key: byo-cust_8842-1" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+15125550199",
"provider": "sip",
"credentials": {
"sipUri": "sip:pbx.example.com",
"username": "trillet",
"password": "YOUR_SIP_PASSWORD",
"ipAddresses": [
{ "id": "carrier-1", "ip": "203.0.113.10", "subnetMask": "32" }
]
}
}'
```
### Twilio account
```bash
curl -X POST https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/numbers/external \
-H "Authorization: Bearer tpk_live_..." \
-H "Idempotency-Key: byo-cust_8842-2" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+15125550188",
"provider": "twilio",
"credentials": { "accountSid": "AC...", "authToken": "..." }
}'
```
The number in E.164 format. A number can be registered only once across Trillet.
`sip` or `twilio`.
For `sip`: `sipUri` (where Trillet sends outbound calls), optional `username` and `password`, and optional `ipAddresses` your carrier sends calls from. For `twilio`: `accountSid` and `authToken`.
Each entry in `ipAddresses` is an object, not a string:
- `id` (required): any string you choose, unique in the list
- `ip`: the IPv4 address
- `subnetMask`: the prefix length as a string, for example `"32"`
A plain list of IP strings, or an entry without `id`, is refused with `400` `number_registration_failed`.
Returns `201` with the number. A refused registration returns `400` `number_registration_failed` with the reason.
## Release a number
```bash
curl -X DELETE https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/numbers/e3e3e3e3e3e3e3e3e3e3e3e3 \
-H "Authorization: Bearer tpk_live_..."
```
A bought number goes back to the carrier and stops renewing. Your own number is detached from Trillet. Returns `{ "object": "phone_number", "id": "...", "released": true }`.
[Deleting a tenant](/voice-engine/tenants#delete-and-restore) releases all of its numbers the same way.
## Assign a number to an agent
Use the standard [assign phone number to agent](/v1/api-reference/endpoints/telephony/bind-call-to-phoneNumber) endpoint, sending the tenant ID in `x-workspace-id`. It needs `resources:write`. The agent's call flow must be live, so [publish its node flow](/voice-engine/authentication#building-an-agent) first.
```bash
curl -X POST https://api.trillet.ai/v1/api/agents/e0e0e0e0e0e0e0e0e0e0e0e0/bind/e3e3e3e3e3e3e3e3e3e3e3e3 \
-H "Authorization: Bearer tpk_live_..." \
-H "x-workspace-id: d9d9d9d9d9d9d9d9d9d9d9d9" \
-H "Content-Type: application/json" \
-d '{ "recordCalls": true }'
```
Send a JSON body, even an empty `{}`. Optional fields include `recordCalls`, `officeHours`, `metadataTags` and `label`. The number must belong to the tenant. `POST /v1/api/agents/{agentId}/release/{phoneNumberId}` unassigns it.
To change a number's settings later without rebinding it, such as recording, office hours or metadata tags, use the standard [update phone number configuration](/v1/api-reference/endpoints/phone-numbers/update-config) endpoint (`PUT /v1/api/twilio/phone-numbers/{phoneNumberId}/config`).
## Events
Buying or registering a number sends `number.provisioned`, with `phoneNumber` and `provider` in `data`. Releasing one sends `number.released`, and so does deleting its tenant, with `reason: "tenant_deleted"` in `data`. A failed renewal sends `number.renewal_failed`. See [Events](/voice-engine/events).
A shared partner SIP trunk for all of your tenants is planned.
---
## Trillet OEM quickstart: first customer, agent and phone call
*Create a tenant for your first customer, give it a voice agent and a phone number, and place a call with the Trillet OEM white-label voice AI API. Examples in curl, Node.js and Python.*
This guide takes you from a partner key to a real phone call in five steps. You will create a tenant for one customer, build a voice agent in it, give it a phone number and place an outbound call. Each step shows the request in curl, Node.js (built-in `fetch`, no SDK) and Python (`requests`), and the response fields the next step uses.
You need Trillet OEM enabled on your account and a phone you can answer for the test call.
## 1. Get a partner key
Create a key in the **OEM API** section of your account settings. An owner or admin of your partner account can do this. Give it every scope for this guide. The key is shown once, so store it in your secrets manager.
Every request sends the key as a bearer token: `Authorization: Bearer tpk_live_...`. Check it works:
```bash cURL
export TRILLET_PARTNER_KEY="tpk_live_..."
curl https://api.trillet.ai/partner/v1/key \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY"
```
```js Node.js
// Node.js 18 or later, run as an ES module (for example quickstart.mjs)
const BASE = 'https://api.trillet.ai';
const KEY = process.env.TRILLET_PARTNER_KEY; // tpk_live_...
// A small helper used in every step of this guide.
async function api(method, path, { body, tenantId, idempotencyKey } = {}) {
const headers = { Authorization: `Bearer ${KEY}` };
if (body !== undefined) headers['Content-Type'] = 'application/json';
if (tenantId) headers['x-workspace-id'] = tenantId;
if (idempotencyKey) headers['Idempotency-Key'] = idempotencyKey;
const res = await fetch(BASE + path, {
method,
headers,
body: body === undefined ? undefined : JSON.stringify(body),
});
const data = await res.json();
if (!res.ok) throw new Error(`${res.status} ${JSON.stringify(data)}`);
return data;
}
const key = await api('GET', '/partner/v1/key');
console.log(key.mode, key.scopes);
```
```python Python
# pip install requests
import os
import requests
BASE = "https://api.trillet.ai"
KEY = os.environ["TRILLET_PARTNER_KEY"] # tpk_live_...
# A small helper used in every step of this guide.
def api(method, path, body=None, tenant_id=None, idempotency_key=None):
headers = {"Authorization": f"Bearer {KEY}"}
if tenant_id:
headers["x-workspace-id"] = tenant_id
if idempotency_key:
headers["Idempotency-Key"] = idempotency_key
r = requests.request(method, BASE + path, json=body, headers=headers, timeout=30)
if not r.ok:
raise RuntimeError(f"{r.status_code} {r.text}")
return r.json()
key = api("GET", "/partner/v1/key")
print(key["mode"], key["scopes"])
```
```json Response
{
"object": "partner_key",
"id": "b3b3b3b3b3b3b3b3b3b3b3b3",
"mode": "live",
"scopes": ["tenants:read", "tenants:write", "resources:read", "resources:write", "calls:write", "numbers:write", "templates:read", "templates:write", "events:read", "webhooks:write", "usage:read", "sessions:write"],
"tenantIds": [],
"partner": { "id": "b0b0b0b0b0b0b0b0b0b0b0b0", "name": "Example Health", "maxTenants": 100, "tenantCount": 0 }
}
```
The Node.js and Python steps below reuse the `api` helper.
## 2. Create a tenant for your customer
A tenant is one of your customers: an isolated workspace with its own agents, numbers, call history and usage. Key it by your own customer ID in `externalId`. `Idempotency-Key` is required, so a retried request never creates two tenants. A monthly spend cap is optional.
```bash cURL
curl -X POST https://api.trillet.ai/partner/v1/tenants \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "Idempotency-Key: create-tenant-cust_8842" \
-H "Content-Type: application/json" \
-d '{
"externalId": "cust_8842",
"name": "Harbour Dental",
"limits": { "monthlySpendCap": 100 }
}'
```
```js Node.js
const tenant = await api('POST', '/partner/v1/tenants', {
idempotencyKey: 'create-tenant-cust_8842',
body: {
externalId: 'cust_8842',
name: 'Harbour Dental',
limits: { monthlySpendCap: 100 },
},
});
const tenantId = tenant.id;
```
```python Python
tenant = api(
"POST",
"/partner/v1/tenants",
idempotency_key="create-tenant-cust_8842",
body={
"externalId": "cust_8842",
"name": "Harbour Dental",
"limits": {"monthlySpendCap": 100},
},
)
tenant_id = tenant["id"]
```
```json Response (201)
{
"object": "tenant",
"id": "d9d9d9d9d9d9d9d9d9d9d9d9",
"externalId": "cust_8842",
"name": "Harbour Dental",
"status": "active",
"region": "us",
"metadata": {},
"limits": { "monthlySpendCap": 100 },
"suspendedAt": null,
"suspendedReason": null,
"deletedAt": null,
"createdAt": "2026-11-02T10:14:00.000Z"
}
```
**Keep `id`.** It is the tenant ID. From here on, requests to standard endpoints send it in the `x-workspace-id` header to act inside this tenant. In curl, set it once: `export TENANT_ID="d9d9d9d9d9d9d9d9d9d9d9d9"`.
## 3. Build and publish an agent
Create a node flow in the tenant. This creates the flow together with its agent and call flow. The smallest working flow has two nodes: a conversation node where the agent talks with the caller, and an end node that closes the call, joined by one edge.
With a partner key, the new agent starts on the model `platform-llm` with recommended speech settings, so no extra configuration is needed for a first call.
```bash cURL
curl -X POST https://api.trillet.ai/v2/api/node-graphs \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "x-workspace-id: $TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"name": "Front desk",
"startNodeId": "greet",
"nodes": [
{
"nodeId": "greet",
"type": "conversation",
"name": "Greeting",
"config": {
"objective": "Say you are the assistant for Harbour Dental, ask how you can help, and answer questions about opening hours: Monday to Friday, 8am to 5pm.",
"prompt": "",
"requiredFields": []
}
},
{
"nodeId": "done",
"type": "end",
"name": "End call",
"config": {
"message": "Thank the caller and end the call politely.",
"disposition": "completed"
}
}
],
"edges": [
{ "id": "e1", "source": "greet", "target": "done", "kind": "auto" }
]
}'
```
```js Node.js
const graph = await api('POST', '/v2/api/node-graphs', {
tenantId,
body: {
name: 'Front desk',
startNodeId: 'greet',
nodes: [
{
nodeId: 'greet',
type: 'conversation',
name: 'Greeting',
config: {
objective:
'Say you are the assistant for Harbour Dental, ask how you can help, and answer questions about opening hours: Monday to Friday, 8am to 5pm.',
prompt: '',
requiredFields: [],
},
},
{
nodeId: 'done',
type: 'end',
name: 'End call',
config: { message: 'Thank the caller and end the call politely.', disposition: 'completed' },
},
],
edges: [{ id: 'e1', source: 'greet', target: 'done', kind: 'auto' }],
},
});
const graphId = graph._id;
```
```python Python
graph = api(
"POST",
"/v2/api/node-graphs",
tenant_id=tenant_id,
body={
"name": "Front desk",
"startNodeId": "greet",
"nodes": [
{
"nodeId": "greet",
"type": "conversation",
"name": "Greeting",
"config": {
"objective": "Say you are the assistant for Harbour Dental, ask how you can help, "
"and answer questions about opening hours: Monday to Friday, 8am to 5pm.",
"prompt": "",
"requiredFields": [],
},
},
{
"nodeId": "done",
"type": "end",
"name": "End call",
"config": {
"message": "Thank the caller and end the call politely.",
"disposition": "completed",
},
},
],
"edges": [{"id": "e1", "source": "greet", "target": "done", "kind": "auto"}],
},
)
graph_id = graph["_id"]
```
The response is `201` with the node flow. **Keep `_id`**, the node flow ID. The flow starts as a draft and cannot take calls until it is published.
Publish it, then read it back to get the agent ID and the call flow ID:
```bash cURL
export GRAPH_ID="e2e2e2e2e2e2e2e2e2e2e2e2"
curl -X POST https://api.trillet.ai/v2/api/node-graphs/$GRAPH_ID/publish \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "x-workspace-id: $TENANT_ID"
curl https://api.trillet.ai/v2/api/node-graphs/$GRAPH_ID \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "x-workspace-id: $TENANT_ID"
```
```js Node.js
await api('POST', `/v2/api/node-graphs/${graphId}/publish`, { tenantId });
const flow = await api('GET', `/v2/api/node-graphs/${graphId}`, { tenantId });
const agentId = flow.pathway.agent._id;
const callFlowId = flow.pathway._id;
```
```python Python
api("POST", f"/v2/api/node-graphs/{graph_id}/publish", tenant_id=tenant_id)
flow = api("GET", f"/v2/api/node-graphs/{graph_id}", tenant_id=tenant_id)
agent_id = flow["pathway"]["agent"]["_id"]
call_flow_id = flow["pathway"]["_id"]
```
```json Response (GET, trimmed)
{
"graph": { "_id": "e2e2e2e2e2e2e2e2e2e2e2e2", "name": "Front desk", "publishedVersion": 1 },
"pathway": {
"_id": "e1e1e1e1e1e1e1e1e1e1e1e1",
"name": "Front desk",
"promptType": "nodes",
"agent": { "_id": "e0e0e0e0e0e0e0e0e0e0e0e0" }
}
}
```
**Keep `pathway.agent._id`** (the agent ID) and `pathway._id` (the call flow ID, used for [call flow settings](/voice-engine/call-flow-settings) such as the greeting). If the flow has a problem, publish returns `400` with `code: "NODE_GRAPH_INVALID"` and a `problems` list.
## 4. Give the agent a phone number
Search for an available number in the tenant, buy it through Trillet OEM so it is billed to your partner account, then bind it to the agent.
```bash cURL
# Search (standard endpoint, inside the tenant)
curl "https://api.trillet.ai/v1/api/twilio/available-numbers?country=US&type=local&areaCode=512" \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "x-workspace-id: $TENANT_ID"
# Buy (Trillet OEM endpoint)
curl -X POST https://api.trillet.ai/partner/v1/tenants/$TENANT_ID/numbers \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "Idempotency-Key: number-cust_8842-1" \
-H "Content-Type: application/json" \
-d '{ "phoneNumber": "+15125550142", "country": "US", "type": "local" }'
# Bind to the agent (standard endpoint, inside the tenant)
export AGENT_ID="e0e0e0e0e0e0e0e0e0e0e0e0"
export NUMBER_ID="e3e3e3e3e3e3e3e3e3e3e3e3"
curl -X POST https://api.trillet.ai/v1/api/agents/$AGENT_ID/bind/$NUMBER_ID \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "x-workspace-id: $TENANT_ID" \
-H "Content-Type: application/json" \
-d '{}'
```
```js Node.js
const search = await api(
'GET',
'/v1/api/twilio/available-numbers?country=US&type=local&areaCode=512',
{ tenantId },
);
const phoneNumber = search.numbers[0].phoneNumber;
const number = await api('POST', `/partner/v1/tenants/${tenantId}/numbers`, {
idempotencyKey: `number-cust_8842-${phoneNumber}`,
body: { phoneNumber, country: 'US', type: 'local' },
});
const numberId = number.id;
await api('POST', `/v1/api/agents/${agentId}/bind/${numberId}`, { tenantId, body: {} });
```
```python Python
search = api(
"GET",
"/v1/api/twilio/available-numbers?country=US&type=local&areaCode=512",
tenant_id=tenant_id,
)
phone_number = search["numbers"][0]["phoneNumber"]
number = api(
"POST",
f"/partner/v1/tenants/{tenant_id}/numbers",
idempotency_key=f"number-cust_8842-{phone_number}",
body={"phoneNumber": phone_number, "country": "US", "type": "local"},
)
number_id = number["id"]
api("POST", f"/v1/api/agents/{agent_id}/bind/{number_id}", tenant_id=tenant_id, body={})
```
```json Response (buy, 201)
{
"object": "phone_number",
"id": "e3e3e3e3e3e3e3e3e3e3e3e3",
"tenantId": "d9d9d9d9d9d9d9d9d9d9d9d9",
"phoneNumber": "+15125550142",
"provider": "telnyx",
"type": "local",
"external": false,
"status": "active",
"agentId": null,
"callFlowId": null,
"billing": { "monthlyPrice": 4.99, "nextChargeAt": "2026-12-02T10:20:00.000Z", "status": "active" },
"createdAt": "2026-11-02T10:20:00.000Z"
}
```
**Keep `id`**, the phone number ID, for binding. Buying charges the first month to your partner account at the standard Trillet number price (from $4.99 per month). The bind call returns the agent. Once bound, the number answers inbound calls with this agent: call it now to hear the agent.
To use a number you already own instead, register it over SIP or Twilio. See [Bring your own numbers](/voice-engine/phone-numbers#bring-your-own-numbers).
### Optional: watch the call events
Add a webhook endpoint before the next step to receive signed `call.started` and `call.ended` events for every tenant. The URL must be a public `https` URL you control. The response includes the signing `secret` (`whsec_...`) once, so store it. See [Verifying signatures](/voice-engine/events#verifying-signatures).
```bash cURL
curl -X POST https://api.trillet.ai/partner/v1/webhook-endpoints \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.example.com/trillet/events",
"enabledEvents": ["call.started", "call.ended"]
}'
```
```js Node.js
const endpoint = await api('POST', '/partner/v1/webhook-endpoints', {
body: {
url: 'https://api.example.com/trillet/events',
enabledEvents: ['call.started', 'call.ended'],
},
});
console.log(endpoint.secret); // whsec_..., shown only now
```
```python Python
endpoint = api(
"POST",
"/partner/v1/webhook-endpoints",
body={
"url": "https://api.example.com/trillet/events",
"enabledEvents": ["call.started", "call.ended"],
},
)
print(endpoint["secret"]) # whsec_..., shown only now
```
`call.started` arrives when the call connects to the agent. `call.ended` arrives after the call's post-call processing finishes, with the duration, cost and (by default) the transcript and summary in `data.call`.
## 5. Place an outbound call
Call your own phone from the tenant's agent. Use E.164 format for `to`. The agent's number is used as the caller ID.
```bash cURL
curl -X POST https://api.trillet.ai/v1/api/call \
-H "Authorization: Bearer $TRILLET_PARTNER_KEY" \
-H "x-workspace-id: $TENANT_ID" \
-H "Content-Type: application/json" \
-d '{
"to": "+15125550177",
"call_agent_id": "'"$AGENT_ID"'",
"from_phone_number_id": "'"$NUMBER_ID"'"
}'
```
```js Node.js
const call = await api('POST', '/v1/api/call', {
tenantId,
body: {
to: '+15125550177', // your phone
call_agent_id: agentId,
from_phone_number_id: numberId,
},
});
console.log(call.callId);
```
```python Python
call = api(
"POST",
"/v1/api/call",
tenant_id=tenant_id,
body={
"to": "+15125550177", # your phone
"call_agent_id": agent_id,
"from_phone_number_id": number_id,
},
)
print(call["callId"])
```
```json Response
{
"status": "success",
"call_agent_id": "e0e0e0e0e0e0e0e0e0e0e0e0",
"callId": "e5e5e5e5e5e5e5e5e5e5e5e5",
"roomName": "...",
"jobId": "..."
}
```
Your phone rings within a few seconds. `callId` is the call history ID: it matches `data.call.id` in call events and `callHistoryId` in [per-call usage](/voice-engine/usage-and-billing#per-call). Calls are charged to your partner account at the standard Trillet rates, from $0.12 per minute. See [Start an outbound call](/voice-engine/authentication#start-an-outbound-call) for every field.
## What you just built
- A **tenant** for one customer, keyed by your customer ID, with a monthly spend cap.
- A **voice agent** in that tenant, built from a published node flow.
- A **phone number** bought for the tenant and billed to your partner account, answering with the agent.
- An **outbound call** placed by the agent, and optionally **signed events** for it.
Repeat steps 2 to 4 for each customer your platform onboards. The same partner key works for all of them.
## Next steps
Change the greeting, speech timing, recording and timers on the call flow.
Verify signatures, retries, the event log and redelivery.
Suspend, resume, delete and restore customers.
Usage per tenant and per call, and monthly caps.
Every Trillet OEM endpoint, generated from the OpenAPI specification.
Download the spec for client generators and API tools.
Trillet OEM is in early access with design partners. [Contact us](https://form.typeform.com/to/qRRENIBp) to join.
---
## Templates and rollouts
*Design an agent once, install it for every Trillet OEM tenant, and roll out new versions safely.*
**Coming soon.** This part of Trillet OEM is planned and not built yet. This page describes the planned design; details may change before release. The rest of Trillet OEM is in early access.
A template is a versioned bundle of call flows, node flows, agents, knowledge bases and settings. You build it in a staging tenant, capture it as a version, and install that version in as many tenants as you like. When you improve it, you roll the new version out to your fleet in stages.
## Recommended workflow
### 1. Build in a staging tenant
Create a tenant for yourself and build the agent in the dashboard or through the API. Test it with text calls and real calls.
### 2. Capture a version
Capture the staging tenant as a template, or add a new version to an existing template. Versions never change once captured.
### 3. Install
Install the template when you create a tenant, or later. Each tenant supplies its own variable values.
### 4. Roll out updates
Start a rollout to move tenants to a new version in batches. It pauses automatically if too many tenants fail.
## Variables
Anything that differs between tenants (practice name, transfer number, office hours, booking calendar) should be a **template variable** rather than a hard-coded value. Variables use the same `{{variable}}` syntax as dynamic variables in prompts.
Variable values belong to the tenant and survive upgrades. Everything else in a template-managed object is replaced on upgrade, so tenant-specific edits made outside variables will be overwritten.
```bash
curl -X PATCH https://api.trillet.ai/partner/v1/tenants/6a9622d2c1e8f3a4b5d6e7f8/templates/tpl_reception \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{ "variables": { "transfer_number": "+15125550111" } }'
```
## Endpoints
| Method | Path | Purpose |
|---|---|---|
| `POST` | `/partner/v1/templates` | Create a template from a source tenant |
| `POST` | `/partner/v1/templates/{id}/versions` | Capture a new version |
| `GET` | `/partner/v1/templates` | List templates |
| `GET` | `/partner/v1/templates/{id}/versions` | List versions |
| `POST` | `/partner/v1/tenants/{id}/templates/{templateId}/install` | Install a version in a tenant |
| `PATCH` | `/partner/v1/tenants/{id}/templates/{templateId}` | Set variables or pin a version |
| `POST` | `/partner/v1/templates/{id}/rollouts` | Start a rollout |
| `GET` | `/partner/v1/rollouts/{id}` | Rollout progress and per-tenant results |
| `POST` | `/partner/v1/rollouts/{id}/pause` | Pause, or `resume`, or `cancel` |
## Rollouts
```bash
curl -X POST https://api.trillet.ai/partner/v1/templates/tpl_reception/rollouts \
-H "Authorization: Bearer tpk_live_..." \
-H "Idempotency-Key: rollout-reception-v5" \
-H "Content-Type: application/json" \
-d '{
"version": 5,
"target": { "metadata": { "plan": "pro" } },
"batchSize": 50,
"pauseOnErrorRate": 0.05,
"skipPinned": true
}'
```
- **Target** all tenants, a list of tenant IDs, or tenants whose `metadata` matches.
- **Pinned** tenants stay on their version until you unpin them. Use pinning for customers who need change control.
- **Rollback** is a rollout to the previous version.
- Upgrades keep the tenant's numbers, IDs and demo links.
- `rollout.completed` and `rollout.paused` events tell you when to look.
---
## Tenants
*Create, update, suspend, delete and restore a workspace for each of your customers with Trillet OEM.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
A tenant is one of your customers. It is an isolated workspace with its own agents, phone numbers, call history, knowledge bases, workflows and usage. Tenants inherit your white-label branding when your account has white-label enabled, and they draw on your account for billing, so a tenant never needs its own card or balance.
## The tenant object
```json
{
"object": "tenant",
"id": "d9d9d9d9d9d9d9d9d9d9d9d9",
"externalId": "cust_8842",
"name": "Harbour Dental",
"status": "active",
"region": "us",
"metadata": { "plan": "pro", "crmAccountId": "0015g00000X" },
"limits": { "monthlySpendCap": 500 },
"suspendedAt": null,
"suspendedReason": null,
"deletedAt": null,
"createdAt": "2026-11-02T10:14:00.000Z"
}
```
| Field | Notes |
|---|---|
| `id` | The tenant ID. Use it in paths and as `x-workspace-id` on standard endpoints. |
| `externalId` | Your ID for this customer, 1 to 128 characters with no leading or trailing spaces. Unique among your live tenants. Look tenants up by it. |
| `status` | `active`, `suspended`, `deleted` or `provisioning_failed` |
| `region` | `us` or `au`. Set at creation; decides where call data is stored. |
| `metadata` | Up to 8 KB of your own JSON data. Trillet does not read it. |
| `limits.monthlySpendCap` | Optional monthly spend cap in USD, or `null`. See [Usage and spend caps](/voice-engine/usage-and-billing#spend-caps). |
## Endpoints
| Method | Path | Scope |
|---|---|---|
| `POST` | `/partner/v1/tenants` | `tenants:write` |
| `GET` | `/partner/v1/tenants` | `tenants:read` |
| `GET` | `/partner/v1/tenants/{tenantId}` | `tenants:read` |
| `GET` | `/partner/v1/tenants/by-external-id/{externalId}` | `tenants:read` |
| `PATCH` | `/partner/v1/tenants/{tenantId}` | `tenants:write` |
| `POST` | `/partner/v1/tenants/{tenantId}/suspend` | `tenants:write` |
| `POST` | `/partner/v1/tenants/{tenantId}/resume` | `tenants:write` |
| `DELETE` | `/partner/v1/tenants/{tenantId}` | `tenants:write` |
| `POST` | `/partner/v1/tenants/{tenantId}/restore` | `tenants:write` |
## Create a tenant
```bash
curl -X POST https://api.trillet.ai/partner/v1/tenants \
-H "Authorization: Bearer tpk_live_..." \
-H "Idempotency-Key: create-tenant-cust_8842" \
-H "Content-Type: application/json" \
-d '{
"externalId": "cust_8842",
"name": "Harbour Dental",
"region": "us",
"metadata": { "plan": "pro" },
"limits": { "monthlySpendCap": 500 }
}'
```
Your ID for this customer.
Display name, up to 100 characters.
`us` or `au`. Defaults to your partner account's region.
Your own data, up to 8 KB.
Monthly spend cap in USD, 0 or more. `null` or leaving it out creates the tenant with no cap. See [Spend caps](/voice-engine/usage-and-billing#spend-caps).
Returns `201` with the tenant. `Idempotency-Key` is required.
If the workspace is created but its setup does not complete, the tenant is returned with status `provisioning_failed`. Contact support with the tenant ID. If you delete it instead, its `externalId` stays reserved for 30 days (see [Delete and restore](#delete-and-restore)).
Each tenant has a wallet linked to your account and starts with no agents, flows or numbers. Build them with the [standard endpoints](/voice-engine/authentication#calling-standard-endpoints-for-a-tenant) and the tenant ID in `x-workspace-id`.
| Status | Code | When |
|---|---|---|
| `409` | `tenant_exists` | A live tenant already has this `externalId` |
| `409` | `tenant_deleted_restorable` | A deleted tenant with this `externalId` can still be restored |
| `409` | `tenant_limit_reached` | Your account is at its tenant limit (`maxTenants` on [`GET /key`](/voice-engine/authentication#check-a-key)) |
| `400` | `invalid_request`, `invalid_external_id`, `invalid_name`, `invalid_metadata`, `invalid_limits` | A field is invalid. `error.param` names it when the request failed schema validation. |
| `400` | `invalid_region` | The region you asked for, or your account's default region, is not available. Contact your account manager. |
## List and look up tenants
```bash
curl "https://api.trillet.ai/partner/v1/tenants?status=active&limit=50" \
-H "Authorization: Bearer tpk_live_..."
curl https://api.trillet.ai/partner/v1/tenants/by-external-id/cust_8842 \
-H "Authorization: Bearer tpk_live_..."
```
`GET /tenants` accepts `status` (`active`, `suspended` or `provisioning_failed`), `externalId`, `limit` and `starting_after`. Deleted tenants are not listed or returned by `GET`; keep the ID if you may restore it. A `starting_after` that is not a tenant ID returns `400` `invalid_cursor`. See [Pagination](/voice-engine/conventions#pagination).
## Update a tenant
```bash
curl -X PATCH https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9 \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{ "name": "Harbour Dental Group", "limits": { "monthlySpendCap": 750 } }'
```
New display name.
Replaces the whole metadata object.
Monthly spend cap in USD, 0 or more. `null` removes the cap.
## Suspend and resume
Suspending a tenant stops its traffic but keeps everything else. Use it for unpaid accounts, offboarding or abuse.
```bash
curl -X POST https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9/suspend \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{ "reason": "Invoice overdue" }'
```
While a tenant is suspended:
- Outbound calls, web calls and SMS are refused with `403` and code `workspace_suspended`.
- New workflow runs are recorded as skipped, with skip reason `workspace_suspended`.
- Inbound calls are answered and ended straight away, with no speech, and recorded in call history with status `blocked`.
- You cannot buy numbers for it (`409` `tenant_suspended`).
- Numbers, agents, configuration and history are kept. You can still read and change them.
`POST /resume` restores traffic immediately. `reason` is optional, up to 500 characters (`400` `invalid_request` otherwise), and is returned as `suspendedReason`.
## Delete and restore
`DELETE` releases the tenant's numbers (each one sends `number.released` with `reason: "tenant_deleted"`), soft-deletes its flows, agents and knowledge bases, and soft-deletes the tenant. It returns the tenant with status `deleted`.
`POST /restore` brings a deleted tenant back within 30 days. After that it returns `410` `restore_window_expired`. Other restore errors: `409` `tenant_not_deleted`, and `409` `tenant_exists` if a live tenant has taken its `externalId` since.
While a deleted tenant can still be restored, creating a new tenant with the same `externalId` returns `409` `tenant_deleted_restorable`. After 30 days the `externalId` is free again.
A delete already in progress returns `409` `tenant_delete_in_progress`.
## Events
Tenant changes emit `tenant.created`, `tenant.updated`, `tenant.suspended`, `tenant.resumed`, `tenant.deleted` and `tenant.restored`. See [Events](/voice-engine/events).
Adopting an existing client workspace as a tenant, and installing a [template](/voice-engine/templates) at creation, are planned.
---
## Usage and spend caps
*Trillet OEM usage per tenant and per call, how tenants are billed, and monthly spend caps.*
**Early access.** Trillet OEM is built and in testing with design partners. Contact your account manager to have it enabled for your account. Details may still change.
## How you are billed
Tenants are billed to your partner account at the standard Trillet rates, the same rates every Trillet customer pays: calls start at $0.12 per minute and phone numbers start at $4.99 per month. Each tenant's wallet is linked to your account, so your tenants do not need cards or balances on Trillet. Charges are drawn from your account balance, or recorded and invoiced to you if your account is set up for invoicing.
Usage amounts in this API are what Trillet charges your account. What you charge your own customers is up to you and is not stored on Trillet.
## Endpoints
| Method | Path | Scope | Returns |
|---|---|---|---|
| `GET` | `/partner/v1/usage` | `usage:read` | Totals by day or month, per tenant or per charge type |
| `GET` | `/partner/v1/usage/calls` | `usage:read` | One row per call charge |
Both accept:
| Parameter | Notes |
|---|---|
| `from` | Start, ISO 8601 date-time, inclusive. Default: the start of the current month (UTC). |
| `to` | End, ISO 8601 date-time, exclusive. Default: now. |
| `tenantId` | Only this tenant |
A range can cover up to 92 days. A bad range returns `400` `invalid_range`. Usage includes deleted tenants, so past months stay complete. A key [restricted to some tenants](/voice-engine/authentication#restricting-a-key-to-some-tenants) sees only those tenants.
### Totals
```bash
curl "https://api.trillet.ai/partner/v1/usage?from=2026-11-01T00:00:00Z&to=2026-12-01T00:00:00Z&granularity=month&groupBy=tenant" \
-H "Authorization: Bearer tpk_live_..."
```
```json
{
"object": "usage",
"from": "2026-11-01T00:00:00.000Z",
"to": "2026-12-01T00:00:00.000Z",
"currency": "usd",
"groupBy": "tenant",
"granularity": "month",
"total": 241.17,
"data": [
{
"period": "2026-11",
"tenantId": "d9d9d9d9d9d9d9d9d9d9d9d9",
"amount": 241.17,
"count": 655,
"billedMinutes": 1030.67
}
]
}
```
| Parameter | Values |
|---|---|
| `groupBy` | `tenant` (default) or `type`. With `type`, each row has `type` instead of `tenantId`. |
| `granularity` | `day` (default, `period` is `YYYY-MM-DD`) or `month` (`period` is `YYYY-MM`). Periods are UTC. |
Each row has `amount` (USD), `count` (number of charges) and, when the charges include call time, `billedMinutes`. The charge types counted as usage are:
| `type` | What |
|---|---|
| `call_charge` | Voice calls |
| `message_charge` | Chat and messaging |
| `sms_charge` | SMS |
| `voice_generation_charge` | Voice generation |
| `antibot_detection_charge` | Bot detection |
| `workflow_charge` | Workflow runs |
| `phone_number_charge`, `phone_number_purchase` | Phone numbers |
Account-level fees, such as plan and white-label fees, are not tenant usage and are not included.
### Per call
```bash
curl "https://api.trillet.ai/partner/v1/usage/calls?tenantId=d9d9d9d9d9d9d9d9d9d9d9d9&limit=100" \
-H "Authorization: Bearer tpk_live_..."
```
```json
{
"object": "list",
"data": [
{
"id": "e7e7e7e7e7e7e7e7e7e7e7e7",
"tenantId": "d9d9d9d9d9d9d9d9d9d9d9d9",
"callId": "SCL_q4Zt8vXbN2kP",
"callHistoryId": "e5e5e5e5e5e5e5e5e5e5e5e5",
"at": "2026-11-02T15:04:12.000Z",
"billedSeconds": 151,
"ratePerMinute": 0.12,
"amount": 0.302
}
],
"hasMore": true
}
```
Rows are newest first. Page with `limit` (1 to 200, default 50) and `starting_after` set to the last row's `id`.
| Field | Notes |
|---|---|
| `id` | The charge ID. Use it as `starting_after`. |
| `callHistoryId` | The call history ID. It matches `data.call.id` in [call events](/voice-engine/events#event-shape) and works with `GET /v2/api/call-history/{callHistoryId}` and `GET /v2/api/recordings/{callHistoryId}`. `null` when the call record cannot be matched. |
| `callId` | Trillet's internal call identifier, kept for reference. Use `callHistoryId` to join with events and call history. |
| `billedSeconds` | The call time charged |
| `ratePerMinute` | The per-minute rate applied. Telephony and other surcharges are in `amount`, not in the rate. |
| `amount` | The charge in USD |
## Spend caps
A spend cap limits a month's usage, from the first of the month (UTC). There are two:
| Cap | Set by | Applies to |
|---|---|---|
| Tenant cap | You, with `limits.monthlySpendCap` on [`PATCH /tenants/{tenantId}`](/voice-engine/tenants#update-a-tenant) | One tenant |
| Account cap | Trillet, on request through your account manager | The total across all of your tenants |
```bash
curl -X PATCH https://api.trillet.ai/partner/v1/tenants/d9d9d9d9d9d9d9d9d9d9d9d9 \
-H "Authorization: Bearer tpk_live_..." \
-H "Content-Type: application/json" \
-d '{ "limits": { "monthlySpendCap": 500 } }'
```
Set `monthlySpendCap` to `null` to remove a tenant cap. A cap of `0` blocks all paid work for the tenant.
### Alerts
When month-to-date usage reaches 80% of a cap, and again at 100%, a `usage.threshold_reached` [event](/voice-engine/events) is sent, once per cap per month:
```json
{
"id": "evt_e8e8e8e8e8e8e8e8e8e8e8e8",
"type": "usage.threshold_reached",
"created": 1762095851,
"livemode": true,
"tenant": { "id": "d9d9d9d9d9d9d9d9d9d9d9d9", "externalId": "cust_8842" },
"data": { "scope": "tenant", "percent": 80, "cap": 500, "monthToDate": 401.25, "month": "2026-11" }
}
```
`scope` is `tenant` or `partner`. For the account cap, `tenant` is `null`.
Caps are not checked on a schedule. Trillet checks a cap, and sends these alerts, only when one of the paid actions listed under [At 100%](#at-100) is about to run. So:
- A tenant with only inbound calls gets no alert, even though its inbound usage counts towards its month-to-date spend. The alert comes with its next paid action.
- If usage goes from under 80% to over 100% between two checks, only the 100% alert is sent.
- With a cap of `0`, the 100% alert is sent on the tenant's first paid action.
### At 100%
Once a tenant reaches its cap, or your account reaches the account cap, these are refused for the rest of the month, as if the account had no funds:
- outbound calls and web calls
- SMS, including chat and SMS replies
- WhatsApp calls
- workflow runs
- batch calls
- buying phone numbers (`402` `insufficient_funds`)
Inbound phone calls continue, so a business's line keeps working. Raise or remove the cap to restore service straight away.
Usage totals for caps are refreshed about once a minute, so a burst of activity can go slightly past a cap before it is enforced.
A partner invoices endpoint and concurrency and outbound pacing limits per tenant are planned.
---
## ServiceM8
*Connect ServiceM8 to a Trillet call flow so your agent can find customers, offer job times, book jobs and add notes during a call.*
Connect a ServiceM8 account to a call flow and your agent can book jobs while it is on the phone. It finds the caller in ServiceM8, offers open times, books the job into your ServiceM8 diary, and reads the job number back to the caller.
You connect ServiceM8 per call flow. Each call flow that should book jobs needs its own connection.
## What the agent can do
When ServiceM8 is connected, the agent has four abilities.
| Ability | What happens in ServiceM8 | What the caller experiences |
| --- | --- | --- |
| **Look up a client** | Searches for an existing client by phone number, then by name. Nothing is changed. | The agent can greet a returning customer. If no match is found, the agent says it will create a record when it books. |
| **Check availability** | Works out open times from your booking hours and the jobs already in the diary. | The agent offers two or three open times. It doesn't read out a long list. |
| **Book a job** | Finds or creates the client, creates a job with the caller's description and address, and places it in the diary. | The agent confirms the day and time and reads out the ServiceM8 job number. |
| **Add a note to the job** | Adds a note to the job booked on this call. | The caller can add details after booking, such as a gate code, access instructions or pets on site. |
The agent always checks availability before it books. If someone else takes the time while the caller is deciding, the agent says the time was just taken and offers other times. It checks the time is still free when it books.
The agent can only add a note to a job it booked on the same call. It can't add notes to existing jobs.
## Before you start
- **A ServiceM8 account** that is active and has the staff members and job queues you want to use.
- **A ServiceM8 API key.** In ServiceM8, go to **Settings > Account Settings > API Keys** and copy the key. Keys start with `smk-`. Copy the key itself, not its name or ID.
- **A saved call flow in Trillet.** Save the call flow before you connect. ServiceM8 can't be connected to a flow that hasn't been saved yet.
## Connect ServiceM8
You can connect from either call flow editor. The connection and its settings are the same in both.
### Call flow editor
#### 1. Open Integrations
Open your call flow and go to **Settings > Advanced Settings > Integrations**. You can also go to **Settings > Tools > + Add > Connect a new app**.
#### 2. Choose ServiceM8
Select **ServiceM8** (Book jobs in your ServiceM8 account).
#### 3. Paste your API key
Paste your ServiceM8 API key into **API Key** and select **Verify & Connect**. Trillet checks the key with ServiceM8 and stores it encrypted.
#### 4. Set your booking settings
Fill in the **Booking settings**. See [Booking settings](#booking-settings) below.
#### 5. Save the call flow
Save and publish the call flow so live calls use the new settings.
The four abilities are added to the agent automatically. You can find them under **Settings > Tools**. Depending on how the call flow was set up, ServiceM8's default instructions may also be switched on in the agent's prompt. If **Skill Prompt** on the ServiceM8 panel is off, turn it on to add them.
### Node flow editor
#### 1. Open Integrations
Open your node flow. In the right panel, select the **Data** tab, then **Connect / manage integrations** under **Integrations**.
#### 2. Choose ServiceM8 and connect
Select **ServiceM8**, paste your API key into **API Key**, and select **Verify & Connect**.
#### 3. Set your booking settings
Fill in the **Booking settings**. See [Booking settings](#booking-settings) below.
#### 4. Turn on abilities for each step
Select a Conversation node, open the **Node** tab, and under **Abilities** turn on the ServiceM8 abilities that step needs: **Look up a client**, **Check availability**, **Book a job** and **Add a note to the job**.
#### 5. Save and publish
Save and publish the flow so live calls use the new settings.
Once connected, the panel shows **Connected**. Select **Test** at any time to check the connection still works.
## Booking settings
These settings appear on the ServiceM8 panel after you connect.
| Setting | What it does | Default |
| --- | --- | --- |
| **Business timezone** | The timezone jobs are booked in. Set it to the same timezone as your ServiceM8 account. See [Timezone](#timezone). | The call flow's timezone |
| **Booking hours** | The agent only offers job times between these hours. | 9:00 to 17:00 |
| **Job duration** | How long each booked job blocks out in the diary: 30, 45, 60, 90 or 120 minutes. | 60 minutes |
| **Default staff member** | The staff member every new job is assigned to. | Any available staff (each job goes to someone free at that time) |
| **Job queue** | The ServiceM8 queue new jobs are added to. | Default queue |
New jobs are created in ServiceM8 with the status **Work Order**.
## Timezone
ServiceM8 stores job times without a timezone, so Trillet needs to know which timezone your business works in.
- **Set Business timezone to the timezone your ServiceM8 account uses.** Jobs are booked, and times are offered to the caller, in that timezone.
- **If you leave it blank,** the panel shows **Agent timezone** and Trillet uses the call flow's own timezone (**Settings > Advanced Settings > Locale**). If that isn't set either, Trillet uses UTC.
If the Business timezone doesn't match your ServiceM8 account, jobs land in the diary at the wrong time, usually off by whole hours. Always set it when your business and your call flow are in different timezones.
## Booking variables
After the agent books a job, Trillet fills in these variables for the call. You can copy them from **Available in messages & workflows** on the ServiceM8 panel.
| Variable | What it contains | Example |
| --- | --- | --- |
| `servicem8_job_number` | The job number as ServiceM8 shows it | `1042` |
| `servicem8_job_uuid` | ServiceM8's internal ID for the job | `a1b2c3d4-…` |
| `servicem8_client_uuid` | ServiceM8's internal ID for the client the job was booked for | `e5f6a7b8-…` |
| `servicem8_job_start` | Scheduled start time (ISO 8601, in the Business timezone) | `2026-11-03T10:00:00+11:00` |
| `servicem8_job_end` | Scheduled end time (ISO 8601, in the Business timezone) | `2026-11-03T11:00:00+11:00` |
| `servicem8_staff_name` | The staff member the job is assigned to | `Sam Taylor` |
If no job was booked on the call, these variables are not set. `servicem8_staff_name` holds whoever the job was assigned to, including a staff member picked automatically.
### Where you can use them
- **Webhooks.** In the webhook's **Custom Payload**, insert a variable as `{{servicem8_job_number}}`. The post-call webhook also includes all six under `call_metadata.extracted_variables`.
- **Workflows.** Use them in workflow steps that run after the call as `{{trigger.extractedVariables.servicem8_job_number}}`, for example to create a follow-up task or send a message.
- **Post-call SMS.** If the call flow sends the caller a post-call SMS, it automatically includes **"Your job number is 1042."** when a job was booked. You don't need to set this up.
### Webhook example
A payload designed in **Custom Payload**:
```json
{
"event": "servicem8_job_booked",
"job_number": "{{servicem8_job_number}}",
"job_start": "{{servicem8_job_start}}",
"job_end": "{{servicem8_job_end}}",
"technician": "{{servicem8_staff_name}}"
}
```
The same values in the post-call webhook:
```json
{
"call_metadata": {
"extracted_variables": {
"servicem8_job_number": "1042",
"servicem8_job_uuid": "a1b2c3d4-...",
"servicem8_client_uuid": "e5f6a7b8-...",
"servicem8_job_start": "2026-11-03T10:00:00+11:00",
"servicem8_job_end": "2026-11-03T11:00:00+11:00",
"servicem8_staff_name": "Sam Taylor"
}
}
}
```
## How customers are matched
When the agent looks up or books for a caller, Trillet searches ServiceM8 in this order:
1. **Phone number.** The caller's number is checked against your ServiceM8 contacts in common formats (with and without the country code).
2. **Name.** The name must match a ServiceM8 client exactly. Differences in capital letters and punctuation are ignored, and common nicknames for the first name count as the same person, so "Bob Smith" finds "Robert Smith".
Trillet doesn't guess. A name that is spelled differently, or only partly matches, is treated as a new customer. When no match is found, booking creates a new client in ServiceM8 with the caller's name, address, phone number and email.
Phone matching is the most reliable. Make sure your existing customers have a mobile or phone number on their ServiceM8 contact.
## Current limits
ServiceM8 support covers booking a new job. Be clear with customers about what it doesn't do yet.
- **One queue, one staff rule.** Every job goes to the **Job queue** you set. With a **Default staff member**, every job goes to that person. With **Any available staff**, each job goes to the first staff member who is free in that slot. The caller can't choose a technician.
- **Availability comes from your booking hours.** Open times are worked out from the **Booking hours** and **Job duration** on the panel, minus jobs already in the diary. They don't come from ServiceM8's own booking windows or staff schedules. Booking hours apply to every day of the week, including weekends.
- **With Any available staff,** a time is offered while at least one staff member is free in it.
- **New bookings only.** The agent can't reschedule a job, cancel a job, or tell a caller the status of an existing job.
- **Notes only on jobs booked in the same call.**
### Coming later
These are planned and not available yet:
- Offering times from ServiceM8's real booking windows and staff schedules.
- Letting the caller choose a staff member.
- Rescheduling and cancelling jobs, and looking up the status of an existing job.
## Troubleshooting
### The panel says the ServiceM8 account isn't active
ServiceM8 rejected the saved API key. This usually means the ServiceM8 account has expired or is unpaid, or the key was revoked.
Make sure the ServiceM8 account is active, create a new API key in ServiceM8, then select **Disconnect** on the panel and connect again with the new key.
### The API key is rejected when I connect
- Check you copied the key itself. ServiceM8 API keys start with `smk-`. A long string of letters and numbers without `smk-` is the key's ID, not the key.
- Check the ServiceM8 account is active.
- If the panel asks you to save first, save the call flow, then connect.
### Jobs appear at the wrong time in ServiceM8
Check **Business timezone** on the ServiceM8 panel. It must match the timezone of your ServiceM8 account. If it is blank, Trillet uses the call flow's timezone, which may be different. Set it, then save and publish the call flow.
### The agent offers times when we're closed
Check **Booking hours** and **Job duration** on the panel. Booking hours apply to every day, so tell the agent in its prompt which days you don't take bookings.
### The agent said it booked, but there's no job in ServiceM8
- Open the call in call history and check whether the agent read out a job number. No job number usually means the booking didn't go through.
- Select **Test** on the ServiceM8 panel to check the connection.
- Check the **Job queue** and **Default staff member** you set, and look for the job in that queue and that person's diary.
- Check the call flow was published after you connected ServiceM8.
### The agent says it can't check availability or book
The agent couldn't reach ServiceM8. It offers to take a message or arrange a call back instead. Select **Test** on the ServiceM8 panel. If the test fails, reconnect with a valid API key.
### Returning customers are created again as new clients
The caller's phone number didn't match a ServiceM8 contact, and their name didn't match exactly. Add the customer's phone number to their ServiceM8 contact so future calls match by phone.
---
## AI chat widget for your website
*Add an AI chat widget to your website with the Trillet Web SDK so visitors can type to your agent in the browser. HTML and React or Next.js examples included.*
Add an AI chat widget to your website with the Trillet Web SDK (`@trillet-ai/web-sdk`). Visitors type messages to your agent in the browser. This page covers the setup steps, a minimal snippet, a complete styled widget and the events the SDK emits.
## Prerequisites
### 1. Get your Workspace ID
In the Trillet Portal sidebar, click the **workspace name dropdown** at the top. Your Workspace ID is displayed next to each workspace - click to copy.
### 2. Get your Agent ID
Navigate to **Call Flows** in the sidebar. Each call flow card displays its **Agent ID** - copy it from the card.
### 3. Enable public access and publish
Open your call flow and click **Website widget** in the editor header, then **Get embed code**. In that dialog, click **Turn on Public Access**, then **Publish changes**. Public Access only counts once it is published: a draft-only change is ignored, and `startPublicCall()` is refused with 403 `Public access not allowed for this agent`. (The same switch is also under **Settings > Advanced Settings > Security & Privacy > HIPAA & Compliance**.)
### 4. Add your site to Domains (recommended)
Go to **Settings > Domains** (under **Workspace > Developer**) and add the domain where you'll embed the widget, for example `yoursite.com`. You can also add it from the **Get embed code** dialog. The change takes effect immediately.
While your workspace has **no** domains listed, public calls are allowed from any site. Once you add **one**, calls from every other site are refused with 403 `Origin not allowed`, so list every site that embeds the widget, including staging. `localhost` and your workspace's own whitelabel portal domain are always allowed.
Never expose your API key in client-side code. The widget uses `startPublicCall()` which only requires the Workspace ID and Agent ID.
## Integration
Choose between a minimal quick-start snippet or a complete styled widget, then pick your framework.
### Quick Start - Minimal snippet
Paste this before the closing `
)}
>
);
}
```
Usage:
```tsx
```
### Full Widget - Complete styled chat widget
A polished chat widget with status indicators, typing animation, and transcript polling. Self-contained HTML file you can use directly or hand off.
#### HTML / CDN
```html