Skip to main content
POST
https://mtxbiyilvgwhbdptysex.supabase.co
/
rest
/
v1
/
agent_configs
Create Agent
curl --request POST \
  --url https://mtxbiyilvgwhbdptysex.supabase.co/rest/v1/agent_configs \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: <content-type>' \
  --header 'apikey: <apikey>' \
  --data '
{
  "name": "<string>",
  "greeting": "<string>",
  "system_prompt": "<string>",
  "voice_id": "<string>",
  "voice_speed": 123,
  "language": "<string>",
  "max_call_duration": 123,
  "end_call_phrases": [
    {}
  ],
  "transfer_number": "<string>",
  "is_active": true
}
'
{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "name is required"
  }
}

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

Headers

Authorization
string
required
Bearer token for authentication.
apikey
string
required
Your Supabase anon key.
Content-Type
string
required
Must be application/json
Prefer
string
Set to return=representation to get the created agent in the response.

Body Parameters

name
string
required
Display name for the agent.Example: "Reception Agent"Constraints:
  • 1-100 characters
  • Must be unique within your account
greeting
string
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
system_prompt
string
required
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
voice_id
string
ID of the voice to use for phone calls.Available voices:
Voice IDDescription
alloyNeutral, professional
echoWarm, friendly
fableExpressive, dynamic
onyxDeep, authoritative
novaBright, energetic
shimmerSoft, calm
Default: alloy
voice_speed
number
Speech rate multiplier.Range: 0.5 to 2.0Default: 1.0
language
string
Primary language for the agent.Default: en-USSupported: en-US, en-GB, es-ES, fr-FR, de-DE
max_call_duration
integer
Maximum call duration in seconds. Call ends automatically after this time.Default: 1800 (30 minutes)Range: 60 to 3600
end_call_phrases
array
Phrases that trigger automatic call termination.Example: ["goodbye", "thank you bye", "that's all"]Default: ["goodbye", "bye", "have a good day"]
transfer_number
string
Phone number to transfer calls to when requested.Example: "+14155551234"
is_active
boolean
Whether the agent is active and can receive calls.Default: true

Response

id
string
Unique identifier (UUID) for the agent.
name
string
Agent display name.
greeting
string
Call greeting message.
system_prompt
string
Agent instructions.
voice_id
string
Selected voice ID.
is_active
boolean
Active status.
created_at
string
ISO 8601 creation timestamp.
updated_at
string
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"
  }
}