Create Assistant
Create a new assistant for a specific org.
curl --request POST \
--url https://api.useinvent.com/orgs/{org_id}/assistants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"avatar_id": "<string>",
"generate_secret_key": true,
"config": {
"instructions": "<string>",
"model": "<string>",
"timezone": "<string>"
},
"contact_fields": [
{
"field_id": "<string>"
}
]
}
'import requests
url = "https://api.useinvent.com/orgs/{org_id}/assistants"
payload = {
"name": "<string>",
"enabled": True,
"avatar_id": "<string>",
"generate_secret_key": True,
"config": {
"instructions": "<string>",
"model": "<string>",
"timezone": "<string>"
},
"contact_fields": [{ "field_id": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
avatar_id: '<string>',
generate_secret_key: true,
config: {instructions: '<string>', model: '<string>', timezone: '<string>'},
contact_fields: [{field_id: '<string>'}]
})
};
fetch('https://api.useinvent.com/orgs/{org_id}/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.useinvent.com/orgs/{org_id}/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>',
'enabled' => true,
'avatar_id' => '<string>',
'generate_secret_key' => true,
'config' => [
'instructions' => '<string>',
'model' => '<string>',
'timezone' => '<string>'
],
'contact_fields' => [
[
'field_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.useinvent.com/orgs/{org_id}/assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"avatar_id\": \"<string>\",\n \"generate_secret_key\": true,\n \"config\": {\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"contact_fields\": [\n {\n \"field_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.useinvent.com/orgs/{org_id}/assistants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"avatar_id\": \"<string>\",\n \"generate_secret_key\": true,\n \"config\": {\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"contact_fields\": [\n {\n \"field_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/orgs/{org_id}/assistants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"avatar_id\": \"<string>\",\n \"generate_secret_key\": true,\n \"config\": {\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"contact_fields\": [\n {\n \"field_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"enabled": true,
"deleted": true,
"secret_key": "<string>",
"avatar_url": "<string>",
"config": {
"model": "<string>",
"stt": {
"model": "<string>"
},
"tts": {
"model": "<string>",
"voice_id": "<string>"
},
"conversation": {
"enable_memories": true,
"enable_transfer_to_human_tool": true,
"welcome_banner": "<string>",
"suggested_messages": [
"<string>"
],
"auto_intro_message": "<string>",
"enable_end_conversation_tool": true,
"enable_block_contact_tool": true,
"enable_ai_replies": true,
"enable_auto_resolve": true,
"enable_auto_follow_ups": true,
"follow_up_instructions": "<string>",
"enable_auto_csat": true,
"enable_private_chats": true,
"enable_update_contact_tool": true
},
"timezone": "<string>",
"instructions": "<string>"
},
"integrations": [
{
"id": "<string>",
"enabled": true,
"assistant_id": "<string>",
"connection_id": "<string>",
"config": {},
"error": "<string>",
"platform_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"actions": [
{
"id": "<string>",
"enabled": true,
"name": "<string>",
"instructions": "<string>",
"action_id": "<string>",
"assistant_id": "<string>",
"connection_id": "<string>",
"config": {
"input": {},
"definitions": [
{
"path": "<string>",
"definition": {}
}
]
},
"position": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"contact_fields": [
{
"field": {
"id": "<string>",
"table_id": "<string>",
"key": "<string>",
"schema": {
"type": "file",
"name": "<string>",
"description": "<string>",
"optional": true,
"array": true,
"placeholder": "<string>",
"display": {},
"order": 1,
"link": "<string>",
"metadata": {},
"allowed_modes": [],
"broadcast_field": true,
"integration_field": true,
"display_field": true,
"conditions": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"hidden": true,
"picker": {
"type": "google_drive",
"views": [],
"selectable_mime_types": [
"<string>"
]
},
"requires": [
"<string>"
],
"disable_variables": true,
"allowed_types": [
"<string>"
],
"visibility": "PRIVATE"
},
"readonly": true,
"kind": "system"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}Authorizations
Bearer token authentication using your API key
Path Parameters
The ID of the org
Body
The assistant information.
Schema for creating a new assistant
The name of the assistant
1 - 1024Whether the assistant is enabled
The ID of the avatar file id
When true, generates a secret key immediately (same as POST …/rotate-secret-key). When omitted or false, no secret key is stored until you rotate.
Schema for creating or updating the configuration of an assistant
Show child attributes
Show child attributes
32Show child attributes
Show child attributes
Response
The created assistant.
Schema for an assistant
The name of the assistant
Whether the assistant is enabled
Whether the assistant has been soft-deleted
The secret key to create session hashes
The URL of the avatar photo
Schema for the configuration of an assistant
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Was this page helpful?
curl --request POST \
--url https://api.useinvent.com/orgs/{org_id}/assistants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"enabled": true,
"avatar_id": "<string>",
"generate_secret_key": true,
"config": {
"instructions": "<string>",
"model": "<string>",
"timezone": "<string>"
},
"contact_fields": [
{
"field_id": "<string>"
}
]
}
'import requests
url = "https://api.useinvent.com/orgs/{org_id}/assistants"
payload = {
"name": "<string>",
"enabled": True,
"avatar_id": "<string>",
"generate_secret_key": True,
"config": {
"instructions": "<string>",
"model": "<string>",
"timezone": "<string>"
},
"contact_fields": [{ "field_id": "<string>" }]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
enabled: true,
avatar_id: '<string>',
generate_secret_key: true,
config: {instructions: '<string>', model: '<string>', timezone: '<string>'},
contact_fields: [{field_id: '<string>'}]
})
};
fetch('https://api.useinvent.com/orgs/{org_id}/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.useinvent.com/orgs/{org_id}/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>',
'enabled' => true,
'avatar_id' => '<string>',
'generate_secret_key' => true,
'config' => [
'instructions' => '<string>',
'model' => '<string>',
'timezone' => '<string>'
],
'contact_fields' => [
[
'field_id' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.useinvent.com/orgs/{org_id}/assistants"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"avatar_id\": \"<string>\",\n \"generate_secret_key\": true,\n \"config\": {\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"contact_fields\": [\n {\n \"field_id\": \"<string>\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.useinvent.com/orgs/{org_id}/assistants")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"avatar_id\": \"<string>\",\n \"generate_secret_key\": true,\n \"config\": {\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"contact_fields\": [\n {\n \"field_id\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useinvent.com/orgs/{org_id}/assistants")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"enabled\": true,\n \"avatar_id\": \"<string>\",\n \"generate_secret_key\": true,\n \"config\": {\n \"instructions\": \"<string>\",\n \"model\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"contact_fields\": [\n {\n \"field_id\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"name": "<string>",
"enabled": true,
"deleted": true,
"secret_key": "<string>",
"avatar_url": "<string>",
"config": {
"model": "<string>",
"stt": {
"model": "<string>"
},
"tts": {
"model": "<string>",
"voice_id": "<string>"
},
"conversation": {
"enable_memories": true,
"enable_transfer_to_human_tool": true,
"welcome_banner": "<string>",
"suggested_messages": [
"<string>"
],
"auto_intro_message": "<string>",
"enable_end_conversation_tool": true,
"enable_block_contact_tool": true,
"enable_ai_replies": true,
"enable_auto_resolve": true,
"enable_auto_follow_ups": true,
"follow_up_instructions": "<string>",
"enable_auto_csat": true,
"enable_private_chats": true,
"enable_update_contact_tool": true
},
"timezone": "<string>",
"instructions": "<string>"
},
"integrations": [
{
"id": "<string>",
"enabled": true,
"assistant_id": "<string>",
"connection_id": "<string>",
"config": {},
"error": "<string>",
"platform_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"actions": [
{
"id": "<string>",
"enabled": true,
"name": "<string>",
"instructions": "<string>",
"action_id": "<string>",
"assistant_id": "<string>",
"connection_id": "<string>",
"config": {
"input": {},
"definitions": [
{
"path": "<string>",
"definition": {}
}
]
},
"position": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"contact_fields": [
{
"field": {
"id": "<string>",
"table_id": "<string>",
"key": "<string>",
"schema": {
"type": "file",
"name": "<string>",
"description": "<string>",
"optional": true,
"array": true,
"placeholder": "<string>",
"display": {},
"order": 1,
"link": "<string>",
"metadata": {},
"allowed_modes": [],
"broadcast_field": true,
"integration_field": true,
"display_field": true,
"conditions": [
{
"field": "<string>",
"value": "<unknown>"
}
],
"hidden": true,
"picker": {
"type": "google_drive",
"views": [],
"selectable_mime_types": [
"<string>"
]
},
"requires": [
"<string>"
],
"disable_variables": true,
"allowed_types": [
"<string>"
],
"visibility": "PRIVATE"
},
"readonly": true,
"kind": "system"
},
"created_at": "2023-11-07T05:31:56Z"
}
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}