Overview
Creates a new AI agent that can handle phone calls, SMS messages, and chat conversations. Agents are fully customizable with their own personality, voice, and capabilities.
Request
Bearer token for authentication.
Set to return=representation to get the created agent in the response.
Body Parameters
Display name for the agent.Example: "Reception Agent"Constraints:
- 1-100 characters
- Must be unique within your account
The message the agent says when answering a call.Example: "Hello, thanks for calling Acme Corp. How can I help you today?"Constraints:
- Maximum 500 characters
- Should be under 15 seconds when spoken
Instructions that define the agent’s personality, knowledge, and behavior. This is the most important setting for customizing agent responses.Example:You are Sarah, a friendly receptionist for Acme Corp.
Your responsibilities:
- Answer questions about our services
- Help callers schedule appointments
- Take messages when needed
Business hours: Monday-Friday, 9am-5pm
Location: 123 Main St, Vancouver BC
Always be professional and helpful.
Constraints:
- Maximum 10,000 characters
- Supports markdown formatting
ID of the voice to use for phone calls.Available voices:| Voice ID | Description |
|---|
alloy | Neutral, professional |
echo | Warm, friendly |
fable | Expressive, dynamic |
onyx | Deep, authoritative |
nova | Bright, energetic |
shimmer | Soft, calm |
Default: alloy
Speech rate multiplier.Range: 0.5 to 2.0Default: 1.0
Primary language for the agent.Default: en-USSupported: en-US, en-GB, es-ES, fr-FR, de-DE
Maximum call duration in seconds. Call ends automatically after this time.Default: 1800 (30 minutes)Range: 60 to 3600
Phrases that trigger automatic call termination.Example: ["goodbye", "thank you bye", "that's all"]Default: ["goodbye", "bye", "have a good day"]
Phone number to transfer calls to when requested.Example: "+14155551234"
Whether the agent is active and can receive calls.Default: true
Response
Unique identifier (UUID) for the agent.
ISO 8601 creation timestamp.
ISO 8601 last update timestamp.
Example Request
curl -X POST "https://mtxbiyilvgwhbdptysex.supabase.co/rest/v1/agent_configs" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "apikey: YOUR_ANON_KEY" \
-H "Content-Type: application/json" \
-H "Prefer: return=representation" \
-d '{
"name": "Reception Agent",
"greeting": "Hello, thanks for calling! How can I help you today?",
"system_prompt": "You are a friendly receptionist. Be helpful and professional.",
"voice_id": "nova"
}'
Example Response
{
"id": "c72ea2b8-1234-5678-9abc-def012345678",
"name": "Reception Agent",
"greeting": "Hello, thanks for calling! How can I help you today?",
"system_prompt": "You are a friendly receptionist. Be helpful and professional.",
"voice_id": "nova",
"voice_speed": 1.0,
"language": "en-US",
"max_call_duration": 1800,
"is_active": true,
"created_at": "2024-01-15T10:00:00.000Z",
"updated_at": "2024-01-15T10:00:00.000Z"
}
Error Responses
{
"error": {
"code": "VALIDATION_ERROR",
"message": "name is required"
}
}
{
"error": {
"code": "UNAUTHORIZED",
"message": "Invalid or expired access token"
}
}
{
"error": {
"code": "DUPLICATE_NAME",
"message": "An agent with this name already exists"
}
}