Create Agent
Creates a new AI agent with the specified configuration. The agent will be created with a single prompt-based flow.
curl --request POST \
--url https://prod-api.ringg.ai/ca/api/v0/public/agent \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"agent_name": "My Sales Agent",
"introduction_and_objective": "You are a customer support agent for Acme Corp.",
"response_guidelines": "Be polite, helpful, and concise. Always confirm understanding.",
"task": "Help customers with their orders and answer product questions.",
"primary_language": "en-IN",
"voice_id": "02ad256b-092b-4048-bea0-5af46a452b98",
"intro_message": "Hello, this is Sarah from Acme Corp. How can I assist you today?",
"faq": "Q: What are your hours? A: We are open 9am-6pm IST.",
"sample_conversations": "User: Hi\nAgent: Hello! How can I help you today?",
"secondary_language": "hi-IN",
"agent_type": "outbound",
"custom_variables": [
"callee_name",
"mobile_number",
"company",
"lead_source"
],
"call_config": {
"call_time": {
"call_start_time": "10:00",
"call_end_time": "18:30",
"timezone": "America/New_York"
},
"max_call_length": 600,
"idle_timeout_warning": 8,
"idle_timeout_end": 20,
"noise_filter_config": {
"filter_noise": true,
"noise_suppression_level": 95
},
"voicemail": {
"detect": true,
"action": "end",
"retry": true
},
"background_audio_config": {
"audio_id": "office_ambience",
"volume": 0.35
},
"mute_during_intro": false
}
}
'import requests
url = "https://prod-api.ringg.ai/ca/api/v0/public/agent"
payload = {
"agent_name": "My Sales Agent",
"introduction_and_objective": "You are a customer support agent for Acme Corp.",
"response_guidelines": "Be polite, helpful, and concise. Always confirm understanding.",
"task": "Help customers with their orders and answer product questions.",
"primary_language": "en-IN",
"voice_id": "02ad256b-092b-4048-bea0-5af46a452b98",
"intro_message": "Hello, this is Sarah from Acme Corp. How can I assist you today?",
"faq": "Q: What are your hours? A: We are open 9am-6pm IST.",
"sample_conversations": "User: Hi
Agent: Hello! How can I help you today?",
"secondary_language": "hi-IN",
"agent_type": "outbound",
"custom_variables": ["callee_name", "mobile_number", "company", "lead_source"],
"call_config": {
"call_time": {
"call_start_time": "10:00",
"call_end_time": "18:30",
"timezone": "America/New_York"
},
"max_call_length": 600,
"idle_timeout_warning": 8,
"idle_timeout_end": 20,
"noise_filter_config": {
"filter_noise": True,
"noise_suppression_level": 95
},
"voicemail": {
"detect": True,
"action": "end",
"retry": True
},
"background_audio_config": {
"audio_id": "office_ambience",
"volume": 0.35
},
"mute_during_intro": False
}
}
headers = {
"X-API-KEY": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_name: 'My Sales Agent',
introduction_and_objective: 'You are a customer support agent for Acme Corp.',
response_guidelines: 'Be polite, helpful, and concise. Always confirm understanding.',
task: 'Help customers with their orders and answer product questions.',
primary_language: 'en-IN',
voice_id: '02ad256b-092b-4048-bea0-5af46a452b98',
intro_message: 'Hello, this is Sarah from Acme Corp. How can I assist you today?',
faq: 'Q: What are your hours? A: We are open 9am-6pm IST.',
sample_conversations: 'User: Hi\nAgent: Hello! How can I help you today?',
secondary_language: 'hi-IN',
agent_type: 'outbound',
custom_variables: ['callee_name', 'mobile_number', 'company', 'lead_source'],
call_config: {
call_time: {call_start_time: '10:00', call_end_time: '18:30', timezone: 'America/New_York'},
max_call_length: 600,
idle_timeout_warning: 8,
idle_timeout_end: 20,
noise_filter_config: {filter_noise: true, noise_suppression_level: 95},
voicemail: {detect: true, action: 'end', retry: true},
background_audio_config: {audio_id: 'office_ambience', volume: 0.35},
mute_during_intro: false
}
})
};
fetch('https://prod-api.ringg.ai/ca/api/v0/public/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.ringg.ai/ca/api/v0/public/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_name' => 'My Sales Agent',
'introduction_and_objective' => 'You are a customer support agent for Acme Corp.',
'response_guidelines' => 'Be polite, helpful, and concise. Always confirm understanding.',
'task' => 'Help customers with their orders and answer product questions.',
'primary_language' => 'en-IN',
'voice_id' => '02ad256b-092b-4048-bea0-5af46a452b98',
'intro_message' => 'Hello, this is Sarah from Acme Corp. How can I assist you today?',
'faq' => 'Q: What are your hours? A: We are open 9am-6pm IST.',
'sample_conversations' => 'User: Hi
Agent: Hello! How can I help you today?',
'secondary_language' => 'hi-IN',
'agent_type' => 'outbound',
'custom_variables' => [
'callee_name',
'mobile_number',
'company',
'lead_source'
],
'call_config' => [
'call_time' => [
'call_start_time' => '10:00',
'call_end_time' => '18:30',
'timezone' => 'America/New_York'
],
'max_call_length' => 600,
'idle_timeout_warning' => 8,
'idle_timeout_end' => 20,
'noise_filter_config' => [
'filter_noise' => true,
'noise_suppression_level' => 95
],
'voicemail' => [
'detect' => true,
'action' => 'end',
'retry' => true
],
'background_audio_config' => [
'audio_id' => 'office_ambience',
'volume' => 0.35
],
'mute_during_intro' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod-api.ringg.ai/ca/api/v0/public/agent"
payload := strings.NewReader("{\n \"agent_name\": \"My Sales Agent\",\n \"introduction_and_objective\": \"You are a customer support agent for Acme Corp.\",\n \"response_guidelines\": \"Be polite, helpful, and concise. Always confirm understanding.\",\n \"task\": \"Help customers with their orders and answer product questions.\",\n \"primary_language\": \"en-IN\",\n \"voice_id\": \"02ad256b-092b-4048-bea0-5af46a452b98\",\n \"intro_message\": \"Hello, this is Sarah from Acme Corp. How can I assist you today?\",\n \"faq\": \"Q: What are your hours? A: We are open 9am-6pm IST.\",\n \"sample_conversations\": \"User: Hi\\nAgent: Hello! How can I help you today?\",\n \"secondary_language\": \"hi-IN\",\n \"agent_type\": \"outbound\",\n \"custom_variables\": [\n \"callee_name\",\n \"mobile_number\",\n \"company\",\n \"lead_source\"\n ],\n \"call_config\": {\n \"call_time\": {\n \"call_start_time\": \"10:00\",\n \"call_end_time\": \"18:30\",\n \"timezone\": \"America/New_York\"\n },\n \"max_call_length\": 600,\n \"idle_timeout_warning\": 8,\n \"idle_timeout_end\": 20,\n \"noise_filter_config\": {\n \"filter_noise\": true,\n \"noise_suppression_level\": 95\n },\n \"voicemail\": {\n \"detect\": true,\n \"action\": \"end\",\n \"retry\": true\n },\n \"background_audio_config\": {\n \"audio_id\": \"office_ambience\",\n \"volume\": 0.35\n },\n \"mute_during_intro\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://prod-api.ringg.ai/ca/api/v0/public/agent")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"My Sales Agent\",\n \"introduction_and_objective\": \"You are a customer support agent for Acme Corp.\",\n \"response_guidelines\": \"Be polite, helpful, and concise. Always confirm understanding.\",\n \"task\": \"Help customers with their orders and answer product questions.\",\n \"primary_language\": \"en-IN\",\n \"voice_id\": \"02ad256b-092b-4048-bea0-5af46a452b98\",\n \"intro_message\": \"Hello, this is Sarah from Acme Corp. How can I assist you today?\",\n \"faq\": \"Q: What are your hours? A: We are open 9am-6pm IST.\",\n \"sample_conversations\": \"User: Hi\\nAgent: Hello! How can I help you today?\",\n \"secondary_language\": \"hi-IN\",\n \"agent_type\": \"outbound\",\n \"custom_variables\": [\n \"callee_name\",\n \"mobile_number\",\n \"company\",\n \"lead_source\"\n ],\n \"call_config\": {\n \"call_time\": {\n \"call_start_time\": \"10:00\",\n \"call_end_time\": \"18:30\",\n \"timezone\": \"America/New_York\"\n },\n \"max_call_length\": 600,\n \"idle_timeout_warning\": 8,\n \"idle_timeout_end\": 20,\n \"noise_filter_config\": {\n \"filter_noise\": true,\n \"noise_suppression_level\": 95\n },\n \"voicemail\": {\n \"detect\": true,\n \"action\": \"end\",\n \"retry\": true\n },\n \"background_audio_config\": {\n \"audio_id\": \"office_ambience\",\n \"volume\": 0.35\n },\n \"mute_during_intro\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.ringg.ai/ca/api/v0/public/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"My Sales Agent\",\n \"introduction_and_objective\": \"You are a customer support agent for Acme Corp.\",\n \"response_guidelines\": \"Be polite, helpful, and concise. Always confirm understanding.\",\n \"task\": \"Help customers with their orders and answer product questions.\",\n \"primary_language\": \"en-IN\",\n \"voice_id\": \"02ad256b-092b-4048-bea0-5af46a452b98\",\n \"intro_message\": \"Hello, this is Sarah from Acme Corp. How can I assist you today?\",\n \"faq\": \"Q: What are your hours? A: We are open 9am-6pm IST.\",\n \"sample_conversations\": \"User: Hi\\nAgent: Hello! How can I help you today?\",\n \"secondary_language\": \"hi-IN\",\n \"agent_type\": \"outbound\",\n \"custom_variables\": [\n \"callee_name\",\n \"mobile_number\",\n \"company\",\n \"lead_source\"\n ],\n \"call_config\": {\n \"call_time\": {\n \"call_start_time\": \"10:00\",\n \"call_end_time\": \"18:30\",\n \"timezone\": \"America/New_York\"\n },\n \"max_call_length\": 600,\n \"idle_timeout_warning\": 8,\n \"idle_timeout_end\": 20,\n \"noise_filter_config\": {\n \"filter_noise\": true,\n \"noise_suppression_level\": 95\n },\n \"voicemail\": {\n \"detect\": true,\n \"action\": \"end\",\n \"retry\": true\n },\n \"background_audio_config\": {\n \"audio_id\": \"office_ambience\",\n \"volume\": 0.35\n },\n \"mute_during_intro\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "edd618d3-f473-4ac1-b5fa-f1a3981666ff",
"version": "v1",
"version_id": "9c2b1f0a-77de-4a1e-9b4e-2f9d5c1a3e88",
"created_at": "2024-12-16T13:03:29.947147+00:00"
},
"message": "Agent created successfully"
}{
"success": false,
"error": {
"code": "VOICE_LANGUAGE_MISMATCH",
"message": "Voice does not support language 'en-US'"
}
}When to use
- Onboard customers into a pre-defined assistant template.
- Create one assistant per team, location, or campaign type.
- Provision assistants from your own admin backend.
Call settings
Passcall_config to fix the assistant’s call behaviour at creation time instead of following up in the dashboard. Every field is optional — omit the block, or any key in it, to accept the default.
| Field | Purpose | Default |
|---|---|---|
call_time | Daily window the assistant may place calls in: call_start_time and call_end_time as HH:MM 24-hour, plus the timezone they are expressed in. | 09:00-21:00 Asia/Kolkata |
max_call_length | Hard cap on call duration, in seconds. | 240 |
idle_timeout_warning | Seconds of caller silence before the assistant checks in (“Are you still there?”). 0 disables the check-in. | 5 |
idle_timeout_end | Seconds of caller silence before the call is dropped. | 10 |
noise_filter_config | Background-noise cancellation on the caller’s audio: filter_noise to switch it on, noise_suppression_level (0-100) for strength. | off, level 80 |
voicemail | Voicemail handling: detect to switch detection on, action for what happens next (end, summarise, static_message), retry to re-queue the call for a later attempt. | detect and retry on, action end |
background_audio_config | Ambient audio mixed under the assistant’s speech: audio_id (office_ambience is the only track) and volume as a 0.0-1.0 fraction. Omit the object to keep it off. | off |
mute_during_intro | When true, the caller cannot interrupt the intro message. Set false to make the first message interruptible. | true |
{
"agent_name": "Support Assistant",
"introduction_and_objective": "You are a support agent for Acme Corp.",
"response_guidelines": "Be polite, helpful, and concise.",
"task": "Help customers with their orders.",
"primary_language": "en-IN",
"voice_id": "your-voice-id",
"intro_message": "Hello, this is Sarah from Acme Corp.",
"call_config": {
"call_time": {
"call_start_time": "10:00",
"call_end_time": "18:30",
"timezone": "America/New_York"
},
"max_call_length": 600,
"idle_timeout_warning": 8,
"idle_timeout_end": 20,
"noise_filter_config": { "filter_noise": true, "noise_suppression_level": 95 },
"voicemail": { "detect": true, "action": "end", "retry": true },
"background_audio_config": { "audio_id": "office_ambience", "volume": 0.35 },
"mute_during_intro": false
}
}
Calling window and timezones
Outside the window an outbound call is not dialled immediately, and retries are pushed to the next opening. The window is per assistant; a campaign or an individual call can override it. Any IANA timezone is supported — this is not India-only.Asia/Kolkata is merely the default when you omit it.
{ "call_time": { "call_start_time": "09:00", "call_end_time": "17:30", "timezone": "America/New_York" } }
{ "call_time": { "call_start_time": "08:00", "call_end_time": "20:00", "timezone": "Europe/London" } }
{ "call_time": { "call_start_time": "10:00", "call_end_time": "19:00", "timezone": "Asia/Dubai" } }
{ "call_time": { "call_start_time": "09:00", "call_end_time": "18:00", "timezone": "Australia/Sydney" } }
{ "call_time": { "call_start_time": "00:00", "call_end_time": "23:59", "timezone": "UTC" } }
"call_start_time": "22:00" with "call_end_time": "06:00" is a valid overnight window.
Region/City form. Abbreviations behave in two different, equally unhelpful ways:IST,PSTandCSTare rejected — they are not IANA zones.EST,MST,HSTandGMTare accepted, and are a trap. They are fixed-offset zones that never observe daylight saving, so an assistant onESTruns an hour behind actual New York time for the ~8 months thatAmerica/New_Yorkis on EDT. UseAmerica/New_York, notEST.
09:00, not 9:00 or 9:00 AM. Both the window and the timezone are validated when you create the assistant, so a bad value fails the create call rather than every call the assistant later tries to place.scheduled_at is not accepted inside call_time here. It schedules one specific call, so on an assistant it would pin every call that assistant ever places to the same timestamp. Pass it per call, on the individual call endpoint’s own call_config.call_time.idle_timeout_warning must be less than idle_timeout_end, otherwise the request is rejected. If the warning fires at or after the hangup, the check-in can never be spoken. Use 0 to disable the check-in and keep only the hangup.background_audio_config.volumeis a fraction between0.0and1.0, not a percentage.50is rejected; send0.5.mute_during_introreads as the opposite of “interruptible”.true(the default) means the caller cannot cut in over the intro message.
call_config is accepted on create only. To change these settings afterwards, use the dashboard — the edit assistant endpoint does not accept them yet, and they are not returned by get assistant.Integration notes
- For most teams, creating the assistant in the dashboard first is simpler.
- Store the returned
agent_id; it is required for calls and campaigns. - Keep prompts concise and make every variable explicit in
custom_args_valuesor campaign CSV mappings.
After creation
Use get assistants to confirm the assistant is visible, then test with one individual call before using campaigns.Headers
(Required) Your Ringg AI API key.
"7251cb4b-3373-43a4-844c-b27a1d45e0c9"
Body
(Required) Name of the agent
100"My Sales Agent"
(Required) Introduction and objective of the agent
2000"You are a customer support agent for Acme Corp."
(Required) Guidelines for how the agent should respond
3000"Be polite, helpful, and concise. Always confirm understanding."
(Required) The task the agent should perform
1500"Help customers with their orders and answer product questions."
(Required) Primary language locale for the agent
en-US, en-IN, hi-IN, ta-IN, te-IN, bn-IN, mr-IN, kn-IN, ka-IN "en-IN"
(Required) Internal AgentVoice ID (UUID). Get available voices from the Get Assistant Voices endpoint.
"02ad256b-092b-4048-bea0-5af46a452b98"
(Required) Introduction message the agent will speak when the call starts
500"Hello, this is Sarah from Acme Corp. How can I assist you today?"
(Optional) FAQ content for the agent
5000"Q: What are your hours? A: We are open 9am-6pm IST."
(Optional) Example conversations for the agent. Use \n for newlines between turns.
5000"User: Hi\nAgent: Hello! How can I help you today?"
(Optional) Secondary language locale for the agent
en-US, en-IN, hi-IN, ta-IN, te-IN, bn-IN, mr-IN, kn-IN, ka-IN "hi-IN"
(Required) Type of agent. Defaults to outbound.
inbound, outbound, outbound_inbound "outbound"
(Optional) Custom variables for the agent. For outbound agents, callee_name and mobile_number are always included automatically.
[
"callee_name",
"mobile_number",
"company",
"lead_source"
]
(Optional) Call behaviour for the agent. Every field is optional — omit the block, or any key in it, to accept the default. These are the same keys the settings are stored under, so what you send here is what the agent runs with.
Show child attributes
Show child attributes
{
"call_time": {
"call_start_time": "10:00",
"call_end_time": "18:30",
"timezone": "America/New_York"
},
"max_call_length": 600,
"idle_timeout_warning": 8,
"idle_timeout_end": 20,
"noise_filter_config": {
"filter_noise": true,
"noise_suppression_level": 95
},
"voicemail": {
"detect": true,
"action": "end",
"retry": true
},
"background_audio_config": {
"audio_id": "office_ambience",
"volume": 0.35
},
"mute_during_intro": false
}
curl --request POST \
--url https://prod-api.ringg.ai/ca/api/v0/public/agent \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <x-api-key>' \
--data '
{
"agent_name": "My Sales Agent",
"introduction_and_objective": "You are a customer support agent for Acme Corp.",
"response_guidelines": "Be polite, helpful, and concise. Always confirm understanding.",
"task": "Help customers with their orders and answer product questions.",
"primary_language": "en-IN",
"voice_id": "02ad256b-092b-4048-bea0-5af46a452b98",
"intro_message": "Hello, this is Sarah from Acme Corp. How can I assist you today?",
"faq": "Q: What are your hours? A: We are open 9am-6pm IST.",
"sample_conversations": "User: Hi\nAgent: Hello! How can I help you today?",
"secondary_language": "hi-IN",
"agent_type": "outbound",
"custom_variables": [
"callee_name",
"mobile_number",
"company",
"lead_source"
],
"call_config": {
"call_time": {
"call_start_time": "10:00",
"call_end_time": "18:30",
"timezone": "America/New_York"
},
"max_call_length": 600,
"idle_timeout_warning": 8,
"idle_timeout_end": 20,
"noise_filter_config": {
"filter_noise": true,
"noise_suppression_level": 95
},
"voicemail": {
"detect": true,
"action": "end",
"retry": true
},
"background_audio_config": {
"audio_id": "office_ambience",
"volume": 0.35
},
"mute_during_intro": false
}
}
'import requests
url = "https://prod-api.ringg.ai/ca/api/v0/public/agent"
payload = {
"agent_name": "My Sales Agent",
"introduction_and_objective": "You are a customer support agent for Acme Corp.",
"response_guidelines": "Be polite, helpful, and concise. Always confirm understanding.",
"task": "Help customers with their orders and answer product questions.",
"primary_language": "en-IN",
"voice_id": "02ad256b-092b-4048-bea0-5af46a452b98",
"intro_message": "Hello, this is Sarah from Acme Corp. How can I assist you today?",
"faq": "Q: What are your hours? A: We are open 9am-6pm IST.",
"sample_conversations": "User: Hi
Agent: Hello! How can I help you today?",
"secondary_language": "hi-IN",
"agent_type": "outbound",
"custom_variables": ["callee_name", "mobile_number", "company", "lead_source"],
"call_config": {
"call_time": {
"call_start_time": "10:00",
"call_end_time": "18:30",
"timezone": "America/New_York"
},
"max_call_length": 600,
"idle_timeout_warning": 8,
"idle_timeout_end": 20,
"noise_filter_config": {
"filter_noise": True,
"noise_suppression_level": 95
},
"voicemail": {
"detect": True,
"action": "end",
"retry": True
},
"background_audio_config": {
"audio_id": "office_ambience",
"volume": 0.35
},
"mute_during_intro": False
}
}
headers = {
"X-API-KEY": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agent_name: 'My Sales Agent',
introduction_and_objective: 'You are a customer support agent for Acme Corp.',
response_guidelines: 'Be polite, helpful, and concise. Always confirm understanding.',
task: 'Help customers with their orders and answer product questions.',
primary_language: 'en-IN',
voice_id: '02ad256b-092b-4048-bea0-5af46a452b98',
intro_message: 'Hello, this is Sarah from Acme Corp. How can I assist you today?',
faq: 'Q: What are your hours? A: We are open 9am-6pm IST.',
sample_conversations: 'User: Hi\nAgent: Hello! How can I help you today?',
secondary_language: 'hi-IN',
agent_type: 'outbound',
custom_variables: ['callee_name', 'mobile_number', 'company', 'lead_source'],
call_config: {
call_time: {call_start_time: '10:00', call_end_time: '18:30', timezone: 'America/New_York'},
max_call_length: 600,
idle_timeout_warning: 8,
idle_timeout_end: 20,
noise_filter_config: {filter_noise: true, noise_suppression_level: 95},
voicemail: {detect: true, action: 'end', retry: true},
background_audio_config: {audio_id: 'office_ambience', volume: 0.35},
mute_during_intro: false
}
})
};
fetch('https://prod-api.ringg.ai/ca/api/v0/public/agent', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://prod-api.ringg.ai/ca/api/v0/public/agent",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agent_name' => 'My Sales Agent',
'introduction_and_objective' => 'You are a customer support agent for Acme Corp.',
'response_guidelines' => 'Be polite, helpful, and concise. Always confirm understanding.',
'task' => 'Help customers with their orders and answer product questions.',
'primary_language' => 'en-IN',
'voice_id' => '02ad256b-092b-4048-bea0-5af46a452b98',
'intro_message' => 'Hello, this is Sarah from Acme Corp. How can I assist you today?',
'faq' => 'Q: What are your hours? A: We are open 9am-6pm IST.',
'sample_conversations' => 'User: Hi
Agent: Hello! How can I help you today?',
'secondary_language' => 'hi-IN',
'agent_type' => 'outbound',
'custom_variables' => [
'callee_name',
'mobile_number',
'company',
'lead_source'
],
'call_config' => [
'call_time' => [
'call_start_time' => '10:00',
'call_end_time' => '18:30',
'timezone' => 'America/New_York'
],
'max_call_length' => 600,
'idle_timeout_warning' => 8,
'idle_timeout_end' => 20,
'noise_filter_config' => [
'filter_noise' => true,
'noise_suppression_level' => 95
],
'voicemail' => [
'detect' => true,
'action' => 'end',
'retry' => true
],
'background_audio_config' => [
'audio_id' => 'office_ambience',
'volume' => 0.35
],
'mute_during_intro' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://prod-api.ringg.ai/ca/api/v0/public/agent"
payload := strings.NewReader("{\n \"agent_name\": \"My Sales Agent\",\n \"introduction_and_objective\": \"You are a customer support agent for Acme Corp.\",\n \"response_guidelines\": \"Be polite, helpful, and concise. Always confirm understanding.\",\n \"task\": \"Help customers with their orders and answer product questions.\",\n \"primary_language\": \"en-IN\",\n \"voice_id\": \"02ad256b-092b-4048-bea0-5af46a452b98\",\n \"intro_message\": \"Hello, this is Sarah from Acme Corp. How can I assist you today?\",\n \"faq\": \"Q: What are your hours? A: We are open 9am-6pm IST.\",\n \"sample_conversations\": \"User: Hi\\nAgent: Hello! How can I help you today?\",\n \"secondary_language\": \"hi-IN\",\n \"agent_type\": \"outbound\",\n \"custom_variables\": [\n \"callee_name\",\n \"mobile_number\",\n \"company\",\n \"lead_source\"\n ],\n \"call_config\": {\n \"call_time\": {\n \"call_start_time\": \"10:00\",\n \"call_end_time\": \"18:30\",\n \"timezone\": \"America/New_York\"\n },\n \"max_call_length\": 600,\n \"idle_timeout_warning\": 8,\n \"idle_timeout_end\": 20,\n \"noise_filter_config\": {\n \"filter_noise\": true,\n \"noise_suppression_level\": 95\n },\n \"voicemail\": {\n \"detect\": true,\n \"action\": \"end\",\n \"retry\": true\n },\n \"background_audio_config\": {\n \"audio_id\": \"office_ambience\",\n \"volume\": 0.35\n },\n \"mute_during_intro\": false\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<x-api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://prod-api.ringg.ai/ca/api/v0/public/agent")
.header("X-API-KEY", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"agent_name\": \"My Sales Agent\",\n \"introduction_and_objective\": \"You are a customer support agent for Acme Corp.\",\n \"response_guidelines\": \"Be polite, helpful, and concise. Always confirm understanding.\",\n \"task\": \"Help customers with their orders and answer product questions.\",\n \"primary_language\": \"en-IN\",\n \"voice_id\": \"02ad256b-092b-4048-bea0-5af46a452b98\",\n \"intro_message\": \"Hello, this is Sarah from Acme Corp. How can I assist you today?\",\n \"faq\": \"Q: What are your hours? A: We are open 9am-6pm IST.\",\n \"sample_conversations\": \"User: Hi\\nAgent: Hello! How can I help you today?\",\n \"secondary_language\": \"hi-IN\",\n \"agent_type\": \"outbound\",\n \"custom_variables\": [\n \"callee_name\",\n \"mobile_number\",\n \"company\",\n \"lead_source\"\n ],\n \"call_config\": {\n \"call_time\": {\n \"call_start_time\": \"10:00\",\n \"call_end_time\": \"18:30\",\n \"timezone\": \"America/New_York\"\n },\n \"max_call_length\": 600,\n \"idle_timeout_warning\": 8,\n \"idle_timeout_end\": 20,\n \"noise_filter_config\": {\n \"filter_noise\": true,\n \"noise_suppression_level\": 95\n },\n \"voicemail\": {\n \"detect\": true,\n \"action\": \"end\",\n \"retry\": true\n },\n \"background_audio_config\": {\n \"audio_id\": \"office_ambience\",\n \"volume\": 0.35\n },\n \"mute_during_intro\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://prod-api.ringg.ai/ca/api/v0/public/agent")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agent_name\": \"My Sales Agent\",\n \"introduction_and_objective\": \"You are a customer support agent for Acme Corp.\",\n \"response_guidelines\": \"Be polite, helpful, and concise. Always confirm understanding.\",\n \"task\": \"Help customers with their orders and answer product questions.\",\n \"primary_language\": \"en-IN\",\n \"voice_id\": \"02ad256b-092b-4048-bea0-5af46a452b98\",\n \"intro_message\": \"Hello, this is Sarah from Acme Corp. How can I assist you today?\",\n \"faq\": \"Q: What are your hours? A: We are open 9am-6pm IST.\",\n \"sample_conversations\": \"User: Hi\\nAgent: Hello! How can I help you today?\",\n \"secondary_language\": \"hi-IN\",\n \"agent_type\": \"outbound\",\n \"custom_variables\": [\n \"callee_name\",\n \"mobile_number\",\n \"company\",\n \"lead_source\"\n ],\n \"call_config\": {\n \"call_time\": {\n \"call_start_time\": \"10:00\",\n \"call_end_time\": \"18:30\",\n \"timezone\": \"America/New_York\"\n },\n \"max_call_length\": 600,\n \"idle_timeout_warning\": 8,\n \"idle_timeout_end\": 20,\n \"noise_filter_config\": {\n \"filter_noise\": true,\n \"noise_suppression_level\": 95\n },\n \"voicemail\": {\n \"detect\": true,\n \"action\": \"end\",\n \"retry\": true\n },\n \"background_audio_config\": {\n \"audio_id\": \"office_ambience\",\n \"volume\": 0.35\n },\n \"mute_during_intro\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "edd618d3-f473-4ac1-b5fa-f1a3981666ff",
"version": "v1",
"version_id": "9c2b1f0a-77de-4a1e-9b4e-2f9d5c1a3e88",
"created_at": "2024-12-16T13:03:29.947147+00:00"
},
"message": "Agent created successfully"
}{
"success": false,
"error": {
"code": "VOICE_LANGUAGE_MISMATCH",
"message": "Voice does not support language 'en-US'"
}
}