curl --request POST \
--url https://api.puretalk.ai/api/ai-assistants \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"voice": 123,
"prompt": "<string>",
"begin_message": "<string>",
"who_speaks_first": "assistant",
"model": "puretalk-plg",
"call_recording_enabled": true,
"assistant_type": "single_prompt",
"avatar": "<string>",
"custom_knowledge_base": "<string>",
"timezone": "<string>",
"reminder_message_frequency": 123,
"max_reminder_messages": 123,
"voice_stability": "<string>",
"voice_clarity_similarity": "<string>",
"voice_stream_latency_optimization": 123,
"voice_boost": false,
"knowledge_base": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"behavior": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.puretalk.ai/api/ai-assistants"
payload = {
"name": "<string>",
"voice": 123,
"prompt": "<string>",
"begin_message": "<string>",
"who_speaks_first": "assistant",
"model": "puretalk-plg",
"call_recording_enabled": True,
"assistant_type": "single_prompt",
"avatar": "<string>",
"custom_knowledge_base": "<string>",
"timezone": "<string>",
"reminder_message_frequency": 123,
"max_reminder_messages": 123,
"voice_stability": "<string>",
"voice_clarity_similarity": "<string>",
"voice_stream_latency_optimization": 123,
"voice_boost": False,
"knowledge_base": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"behavior": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
name: '<string>',
voice: 123,
prompt: '<string>',
begin_message: '<string>',
who_speaks_first: 'assistant',
model: 'puretalk-plg',
call_recording_enabled: true,
assistant_type: 'single_prompt',
avatar: '<string>',
custom_knowledge_base: '<string>',
timezone: '<string>',
reminder_message_frequency: 123,
max_reminder_messages: 123,
voice_stability: '<string>',
voice_clarity_similarity: '<string>',
voice_stream_latency_optimization: 123,
voice_boost: false,
knowledge_base: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
template: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
behavior: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.puretalk.ai/api/ai-assistants', 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.puretalk.ai/api/ai-assistants",
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([
'name' => '<string>',
'voice' => 123,
'prompt' => '<string>',
'begin_message' => '<string>',
'who_speaks_first' => 'assistant',
'model' => 'puretalk-plg',
'call_recording_enabled' => true,
'assistant_type' => 'single_prompt',
'avatar' => '<string>',
'custom_knowledge_base' => '<string>',
'timezone' => '<string>',
'reminder_message_frequency' => 123,
'max_reminder_messages' => 123,
'voice_stability' => '<string>',
'voice_clarity_similarity' => '<string>',
'voice_stream_latency_optimization' => 123,
'voice_boost' => false,
'knowledge_base' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'template' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'behavior' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.puretalk.ai/api/ai-assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"voice\": 123,\n \"prompt\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"who_speaks_first\": \"assistant\",\n \"model\": \"puretalk-plg\",\n \"call_recording_enabled\": true,\n \"assistant_type\": \"single_prompt\",\n \"avatar\": \"<string>\",\n \"custom_knowledge_base\": \"<string>\",\n \"timezone\": \"<string>\",\n \"reminder_message_frequency\": 123,\n \"max_reminder_messages\": 123,\n \"voice_stability\": \"<string>\",\n \"voice_clarity_similarity\": \"<string>\",\n \"voice_stream_latency_optimization\": 123,\n \"voice_boost\": false,\n \"knowledge_base\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"behavior\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.puretalk.ai/api/ai-assistants")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"voice\": 123,\n \"prompt\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"who_speaks_first\": \"assistant\",\n \"model\": \"puretalk-plg\",\n \"call_recording_enabled\": true,\n \"assistant_type\": \"single_prompt\",\n \"avatar\": \"<string>\",\n \"custom_knowledge_base\": \"<string>\",\n \"timezone\": \"<string>\",\n \"reminder_message_frequency\": 123,\n \"max_reminder_messages\": 123,\n \"voice_stability\": \"<string>\",\n \"voice_clarity_similarity\": \"<string>\",\n \"voice_stream_latency_optimization\": 123,\n \"voice_boost\": false,\n \"knowledge_base\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"behavior\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puretalk.ai/api/ai-assistants")
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 \"name\": \"<string>\",\n \"voice\": 123,\n \"prompt\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"who_speaks_first\": \"assistant\",\n \"model\": \"puretalk-plg\",\n \"call_recording_enabled\": true,\n \"assistant_type\": \"single_prompt\",\n \"avatar\": \"<string>\",\n \"custom_knowledge_base\": \"<string>\",\n \"timezone\": \"<string>\",\n \"reminder_message_frequency\": 123,\n \"max_reminder_messages\": 123,\n \"voice_stability\": \"<string>\",\n \"voice_clarity_similarity\": \"<string>\",\n \"voice_stream_latency_optimization\": 123,\n \"voice_boost\": false,\n \"knowledge_base\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"behavior\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"msg": "<string>",
"err": true,
"results": {
"assistant_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "My AI Assistant",
"prompt": "Hello, how are you?",
"model": "gpt-3.5-turbo",
"who_speaks_first": "assistant",
"begin_message": "Hello, how are you?",
"assistant_type": "single_prompt",
"avatar": "<string>",
"custom_knowledge_base": "<string>",
"timezone": "<string>",
"voice_stability": 0.5,
"voice_clarity_similarity": 0.5,
"voice_stream_latency_optimization": 2,
"voice_boost": false,
"voice_speed": 0,
"voice_emotion": [],
"call_recording_enabled": true,
"reminder_message_frequency": 1,
"max_reminder_messages": 1,
"post_analysis": "<string>",
"chatbot_logo": "<string>",
"chatbot_accent_color": "<string>",
"chatbot_faq": "<string>",
"chatbot_whitelisted_domains": [
"<string>"
],
"chatbot_begin_message": "<string>",
"tools": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"behavior": 1,
"user": {
"name": "<string>",
"dp": "<string>",
"email": "[email protected]"
},
"voice": {
"voice_id": "<string>",
"name": "<string>",
"avatar": "<string>",
"gender": "<string>",
"demo_audio_url": "<string>",
"is_cloned": true,
"language": "<string>",
"description": "<string>"
}
}
}{
"err": true,
"msg": "<string>"
}Create Assistants
Create a new AI Assistant
curl --request POST \
--url https://api.puretalk.ai/api/ai-assistants \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "<string>",
"voice": 123,
"prompt": "<string>",
"begin_message": "<string>",
"who_speaks_first": "assistant",
"model": "puretalk-plg",
"call_recording_enabled": true,
"assistant_type": "single_prompt",
"avatar": "<string>",
"custom_knowledge_base": "<string>",
"timezone": "<string>",
"reminder_message_frequency": 123,
"max_reminder_messages": 123,
"voice_stability": "<string>",
"voice_clarity_similarity": "<string>",
"voice_stream_latency_optimization": 123,
"voice_boost": false,
"knowledge_base": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"behavior": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'import requests
url = "https://api.puretalk.ai/api/ai-assistants"
payload = {
"name": "<string>",
"voice": 123,
"prompt": "<string>",
"begin_message": "<string>",
"who_speaks_first": "assistant",
"model": "puretalk-plg",
"call_recording_enabled": True,
"assistant_type": "single_prompt",
"avatar": "<string>",
"custom_knowledge_base": "<string>",
"timezone": "<string>",
"reminder_message_frequency": 123,
"max_reminder_messages": 123,
"voice_stability": "<string>",
"voice_clarity_similarity": "<string>",
"voice_stream_latency_optimization": 123,
"voice_boost": False,
"knowledge_base": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"template": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"behavior": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
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({
name: '<string>',
voice: 123,
prompt: '<string>',
begin_message: '<string>',
who_speaks_first: 'assistant',
model: 'puretalk-plg',
call_recording_enabled: true,
assistant_type: 'single_prompt',
avatar: '<string>',
custom_knowledge_base: '<string>',
timezone: '<string>',
reminder_message_frequency: 123,
max_reminder_messages: 123,
voice_stability: '<string>',
voice_clarity_similarity: '<string>',
voice_stream_latency_optimization: 123,
voice_boost: false,
knowledge_base: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
template: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
behavior: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
})
};
fetch('https://api.puretalk.ai/api/ai-assistants', 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.puretalk.ai/api/ai-assistants",
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([
'name' => '<string>',
'voice' => 123,
'prompt' => '<string>',
'begin_message' => '<string>',
'who_speaks_first' => 'assistant',
'model' => 'puretalk-plg',
'call_recording_enabled' => true,
'assistant_type' => 'single_prompt',
'avatar' => '<string>',
'custom_knowledge_base' => '<string>',
'timezone' => '<string>',
'reminder_message_frequency' => 123,
'max_reminder_messages' => 123,
'voice_stability' => '<string>',
'voice_clarity_similarity' => '<string>',
'voice_stream_latency_optimization' => 123,
'voice_boost' => false,
'knowledge_base' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'template' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'behavior' => '3c90c3cc-0d44-4b50-8888-8dd25736052a'
]),
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.puretalk.ai/api/ai-assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"voice\": 123,\n \"prompt\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"who_speaks_first\": \"assistant\",\n \"model\": \"puretalk-plg\",\n \"call_recording_enabled\": true,\n \"assistant_type\": \"single_prompt\",\n \"avatar\": \"<string>\",\n \"custom_knowledge_base\": \"<string>\",\n \"timezone\": \"<string>\",\n \"reminder_message_frequency\": 123,\n \"max_reminder_messages\": 123,\n \"voice_stability\": \"<string>\",\n \"voice_clarity_similarity\": \"<string>\",\n \"voice_stream_latency_optimization\": 123,\n \"voice_boost\": false,\n \"knowledge_base\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"behavior\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\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.puretalk.ai/api/ai-assistants")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"voice\": 123,\n \"prompt\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"who_speaks_first\": \"assistant\",\n \"model\": \"puretalk-plg\",\n \"call_recording_enabled\": true,\n \"assistant_type\": \"single_prompt\",\n \"avatar\": \"<string>\",\n \"custom_knowledge_base\": \"<string>\",\n \"timezone\": \"<string>\",\n \"reminder_message_frequency\": 123,\n \"max_reminder_messages\": 123,\n \"voice_stability\": \"<string>\",\n \"voice_clarity_similarity\": \"<string>\",\n \"voice_stream_latency_optimization\": 123,\n \"voice_boost\": false,\n \"knowledge_base\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"behavior\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.puretalk.ai/api/ai-assistants")
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 \"name\": \"<string>\",\n \"voice\": 123,\n \"prompt\": \"<string>\",\n \"begin_message\": \"<string>\",\n \"who_speaks_first\": \"assistant\",\n \"model\": \"puretalk-plg\",\n \"call_recording_enabled\": true,\n \"assistant_type\": \"single_prompt\",\n \"avatar\": \"<string>\",\n \"custom_knowledge_base\": \"<string>\",\n \"timezone\": \"<string>\",\n \"reminder_message_frequency\": 123,\n \"max_reminder_messages\": 123,\n \"voice_stability\": \"<string>\",\n \"voice_clarity_similarity\": \"<string>\",\n \"voice_stream_latency_optimization\": 123,\n \"voice_boost\": false,\n \"knowledge_base\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"template\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"behavior\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n}"
response = http.request(request)
puts response.read_body{
"msg": "<string>",
"err": true,
"results": {
"assistant_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "My AI Assistant",
"prompt": "Hello, how are you?",
"model": "gpt-3.5-turbo",
"who_speaks_first": "assistant",
"begin_message": "Hello, how are you?",
"assistant_type": "single_prompt",
"avatar": "<string>",
"custom_knowledge_base": "<string>",
"timezone": "<string>",
"voice_stability": 0.5,
"voice_clarity_similarity": 0.5,
"voice_stream_latency_optimization": 2,
"voice_boost": false,
"voice_speed": 0,
"voice_emotion": [],
"call_recording_enabled": true,
"reminder_message_frequency": 1,
"max_reminder_messages": 1,
"post_analysis": "<string>",
"chatbot_logo": "<string>",
"chatbot_accent_color": "<string>",
"chatbot_faq": "<string>",
"chatbot_whitelisted_domains": [
"<string>"
],
"chatbot_begin_message": "<string>",
"tools": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"behavior": 1,
"user": {
"name": "<string>",
"dp": "<string>",
"email": "[email protected]"
},
"voice": {
"voice_id": "<string>",
"name": "<string>",
"avatar": "<string>",
"gender": "<string>",
"demo_audio_url": "<string>",
"is_cloned": true,
"language": "<string>",
"description": "<string>"
}
}
}{
"err": true,
"msg": "<string>"
}Authorizations
Authorization header containing API key. You can find your API key in the dashboard under 'API Keys'.
Body
- Option 1
- Option 2
The name of the AI Assistant
The voice id of the AI Assistant
The prompt of the AI Assistant
The begin message of the AI Assistant
Who speaks first value of the AI Assistant
assistant The model of the AI Assistant
puretalk-plg If call recording is enabled for the AI Assistant
The assistant type of the AI Assistant
single_prompt, multi_prompt The avatar url of the AI Assistant
The custom knowledge base of the AI Assistant
The timezone of the AI Assistant
The reminder message frequency of the AI Assistant
The maximum reminder messages of the AI Assistant
The voice stability of the AI Assistant
The voice clarity similarity of the AI Assistant
The voice stream latency optimization of the AI Assistant
Indicates if voice boost is enabled for the AI Assistant
The knowledge base id of the AI Assistant
The template id of the AI Assistant
The behavior id of the AI Assistant
Was this page helpful?