curl --request POST \
--url https://api.revring.ai/v1/agents/draft \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyName": "Bright Smile Dental",
"description": "Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142."
}
'import requests
url = "https://api.revring.ai/v1/agents/draft"
payload = {
"companyName": "Bright Smile Dental",
"description": "Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142."
}
headers = {
"x-api-key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyName: 'Bright Smile Dental',
description: 'Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.'
})
};
fetch('https://api.revring.ai/v1/agents/draft', 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://api.revring.ai/v1/agents/draft",
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([
'companyName' => 'Bright Smile Dental',
'description' => 'Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://api.revring.ai/v1/agents/draft"
payload := strings.NewReader("{\n \"companyName\": \"Bright Smile Dental\",\n \"description\": \"Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.revring.ai/v1/agents/draft")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyName\": \"Bright Smile Dental\",\n \"description\": \"Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revring.ai/v1/agents/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyName\": \"Bright Smile Dental\",\n \"description\": \"Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "Dental front desk",
"direction": "inbound",
"language": "en",
"firstMessage": "Thank you for calling Bright Smile Dental. How can I help you today?",
"promptTemplate": "Role:\nYou are Maya, the front desk agent for Bright Smile Dental...",
"variables": [],
"endCallEnabled": true,
"transferRoutes": [
{
"to_number": "+14155550142",
"condition": "Billing questions about charges or payments"
}
],
"toFillIn": [
"Weekday opening hours",
"Office address"
]
}
}Draft an Agent From a Description
Write an agent from a plain description of what it should do: a name, an opening line, a prompt organized for phone calls, the language, and transfer routes when the description gives a number to transfer to. Nothing is saved: review and edit the draft, then create the agent with Create Agent.
The draft uses only facts from the description. Facts the agent will need but the description does not give (opening hours, prices, an address) are listed in toFillIn instead of being made up; until they are added to the prompt, the agent offers a callback for them. Details that differ for each call (the person’s name, an appointment time) appear as {{variables}} and are listed in variables.
A draft takes about 10 seconds. Up to 30 drafts per hour per organization.
curl --request POST \
--url https://api.revring.ai/v1/agents/draft \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyName": "Bright Smile Dental",
"description": "Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142."
}
'import requests
url = "https://api.revring.ai/v1/agents/draft"
payload = {
"companyName": "Bright Smile Dental",
"description": "Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142."
}
headers = {
"x-api-key": "<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': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyName: 'Bright Smile Dental',
description: 'Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.'
})
};
fetch('https://api.revring.ai/v1/agents/draft', 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://api.revring.ai/v1/agents/draft",
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([
'companyName' => 'Bright Smile Dental',
'description' => 'Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <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://api.revring.ai/v1/agents/draft"
payload := strings.NewReader("{\n \"companyName\": \"Bright Smile Dental\",\n \"description\": \"Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<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://api.revring.ai/v1/agents/draft")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyName\": \"Bright Smile Dental\",\n \"description\": \"Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.revring.ai/v1/agents/draft")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyName\": \"Bright Smile Dental\",\n \"description\": \"Answer calls for our dental office. Book cleanings and checkups, answer basic questions, and send billing questions to our office manager at 415-555-0142.\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"name": "Dental front desk",
"direction": "inbound",
"language": "en",
"firstMessage": "Thank you for calling Bright Smile Dental. How can I help you today?",
"promptTemplate": "Role:\nYou are Maya, the front desk agent for Bright Smile Dental...",
"variables": [],
"endCallEnabled": true,
"transferRoutes": [
{
"to_number": "+14155550142",
"condition": "Billing questions about charges or payments"
}
],
"toFillIn": [
"Weekday opening hours",
"Office address"
]
}
}Authorizations
API key for authentication. Generate API keys from the RevRing dashboard.
Body
What the agent should do, in your own words: who calls or who it calls, what it should get done, what it must not do, and where to send callers it cannot help
20 - 4000The business the agent works for. Used in the prompt and the opening line
100Response
The draft
Show child attributes
Show child attributes