curl --request POST \
--url https://app.base44.com/api/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sales assistant",
"description": "Answers questions about our weekly sales.",
"logo_url": "https://cdn.acme.com/sales-assistant.png"
}
'import requests
url = "https://app.base44.com/api/agents"
payload = {
"name": "Sales assistant",
"description": "Answers questions about our weekly sales.",
"logo_url": "https://cdn.acme.com/sales-assistant.png"
}
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: 'Sales assistant',
description: 'Answers questions about our weekly sales.',
logo_url: 'https://cdn.acme.com/sales-assistant.png'
})
};
fetch('https://app.base44.com/api/agents', 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://app.base44.com/api/agents",
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' => 'Sales assistant',
'description' => 'Answers questions about our weekly sales.',
'logo_url' => 'https://cdn.acme.com/sales-assistant.png'
]),
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://app.base44.com/api/agents"
payload := strings.NewReader("{\n \"name\": \"Sales assistant\",\n \"description\": \"Answers questions about our weekly sales.\",\n \"logo_url\": \"https://cdn.acme.com/sales-assistant.png\"\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://app.base44.com/api/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sales assistant\",\n \"description\": \"Answers questions about our weekly sales.\",\n \"logo_url\": \"https://cdn.acme.com/sales-assistant.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/agents")
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\": \"Sales assistant\",\n \"description\": \"Answers questions about our weekly sales.\",\n \"logo_url\": \"https://cdn.acme.com/sales-assistant.png\"\n}"
response = http.request(request)
puts response.read_body{
"id": "6820f3a4e7b91d003c45a1f2",
"name": "Sales assistant",
"description": "Answers questions about our weekly sales.",
"logo_url": "https://cdn.acme.com/sales-assistant.png"
}Create Superagent
Creates a Superagent that you own. Send it messages through Create Superagent conversation, using the id this returns as agent_id.
The agent is created in your access token’s workspace, or in your default workspace when you use a personal API key. The request waits while the agent’s workspace is set up, which takes a few seconds. If setup fails, the agent is removed and you can retry. A retry after a lost response creates a second agent. A personal access token limited to selected apps can’t call the new agent afterwards, because the agent isn’t on its list.
This endpoint is limited to 5 requests per minute, shared with Create app.
curl --request POST \
--url https://app.base44.com/api/agents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Sales assistant",
"description": "Answers questions about our weekly sales.",
"logo_url": "https://cdn.acme.com/sales-assistant.png"
}
'import requests
url = "https://app.base44.com/api/agents"
payload = {
"name": "Sales assistant",
"description": "Answers questions about our weekly sales.",
"logo_url": "https://cdn.acme.com/sales-assistant.png"
}
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: 'Sales assistant',
description: 'Answers questions about our weekly sales.',
logo_url: 'https://cdn.acme.com/sales-assistant.png'
})
};
fetch('https://app.base44.com/api/agents', 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://app.base44.com/api/agents",
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' => 'Sales assistant',
'description' => 'Answers questions about our weekly sales.',
'logo_url' => 'https://cdn.acme.com/sales-assistant.png'
]),
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://app.base44.com/api/agents"
payload := strings.NewReader("{\n \"name\": \"Sales assistant\",\n \"description\": \"Answers questions about our weekly sales.\",\n \"logo_url\": \"https://cdn.acme.com/sales-assistant.png\"\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://app.base44.com/api/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Sales assistant\",\n \"description\": \"Answers questions about our weekly sales.\",\n \"logo_url\": \"https://cdn.acme.com/sales-assistant.png\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.base44.com/api/agents")
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\": \"Sales assistant\",\n \"description\": \"Answers questions about our weekly sales.\",\n \"logo_url\": \"https://cdn.acme.com/sales-assistant.png\"\n}"
response = http.request(request)
puts response.read_body{
"id": "6820f3a4e7b91d003c45a1f2",
"name": "Sales assistant",
"description": "Answers questions about our weekly sales.",
"logo_url": "https://cdn.acme.com/sales-assistant.png"
}Authorizations
Personal access token, sent as Authorization: Bearer <token>.
Body
Name of the agent. Leading and trailing spaces are removed.
1 - 100"Sales assistant"
Short description of what the agent is for.
2000"Answers questions about our weekly sales."
URL of the agent's logo image.
2000"https://cdn.acme.com/sales-assistant.png"
Response
The new agent.
ID of the agent. Use it as agent_id in the other Superagent endpoints, such as Create Superagent conversation.
"6820f3a4e7b91d003c45a1f2"
Name of the agent.
"Sales assistant"
Description of the agent, or null if none was set.
"Answers questions about our weekly sales."
URL of the agent's logo, or null if none was set.
"https://cdn.acme.com/sales-assistant.png"
Was this page helpful?