Create Task Agent
curl --request POST \
--url https://app.tuco.ai/api/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"mode": "<string>",
"status": "<string>",
"connector": "<string>",
"kbRetrieval": "<string>",
"tone": "<string>",
"canAsk": true,
"typingIndicator": true,
"maxTurns": 123,
"onDoneTag": "<string>",
"writeTagToCrm": true,
"allowedToolIds": [
"<string>"
],
"collectFields": [
"<string>"
]
}
'import requests
url = "https://app.tuco.ai/api/tasks"
payload = {
"name": "<string>",
"prompt": "<string>",
"includeTags": ["<string>"],
"excludeTags": ["<string>"],
"mode": "<string>",
"status": "<string>",
"connector": "<string>",
"kbRetrieval": "<string>",
"tone": "<string>",
"canAsk": True,
"typingIndicator": True,
"maxTurns": 123,
"onDoneTag": "<string>",
"writeTagToCrm": True,
"allowedToolIds": ["<string>"],
"collectFields": ["<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>',
prompt: '<string>',
includeTags: ['<string>'],
excludeTags: ['<string>'],
mode: '<string>',
status: '<string>',
connector: '<string>',
kbRetrieval: '<string>',
tone: '<string>',
canAsk: true,
typingIndicator: true,
maxTurns: 123,
onDoneTag: '<string>',
writeTagToCrm: true,
allowedToolIds: ['<string>'],
collectFields: ['<string>']
})
};
fetch('https://app.tuco.ai/api/tasks', 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.tuco.ai/api/tasks",
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>',
'prompt' => '<string>',
'includeTags' => [
'<string>'
],
'excludeTags' => [
'<string>'
],
'mode' => '<string>',
'status' => '<string>',
'connector' => '<string>',
'kbRetrieval' => '<string>',
'tone' => '<string>',
'canAsk' => true,
'typingIndicator' => true,
'maxTurns' => 123,
'onDoneTag' => '<string>',
'writeTagToCrm' => true,
'allowedToolIds' => [
'<string>'
],
'collectFields' => [
'<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://app.tuco.ai/api/tasks"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"mode\": \"<string>\",\n \"status\": \"<string>\",\n \"connector\": \"<string>\",\n \"kbRetrieval\": \"<string>\",\n \"tone\": \"<string>\",\n \"canAsk\": true,\n \"typingIndicator\": true,\n \"maxTurns\": 123,\n \"onDoneTag\": \"<string>\",\n \"writeTagToCrm\": true,\n \"allowedToolIds\": [\n \"<string>\"\n ],\n \"collectFields\": [\n \"<string>\"\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://app.tuco.ai/api/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"mode\": \"<string>\",\n \"status\": \"<string>\",\n \"connector\": \"<string>\",\n \"kbRetrieval\": \"<string>\",\n \"tone\": \"<string>\",\n \"canAsk\": true,\n \"typingIndicator\": true,\n \"maxTurns\": 123,\n \"onDoneTag\": \"<string>\",\n \"writeTagToCrm\": true,\n \"allowedToolIds\": [\n \"<string>\"\n ],\n \"collectFields\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/tasks")
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 \"prompt\": \"<string>\",\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"mode\": \"<string>\",\n \"status\": \"<string>\",\n \"connector\": \"<string>\",\n \"kbRetrieval\": \"<string>\",\n \"tone\": \"<string>\",\n \"canAsk\": true,\n \"typingIndicator\": true,\n \"maxTurns\": 123,\n \"onDoneTag\": \"<string>\",\n \"writeTagToCrm\": true,\n \"allowedToolIds\": [\n \"<string>\"\n ],\n \"collectFields\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyGoal Bots
Create Task Agent
Alias of POST /api/goal-bots. Task agents and goal bots are the same thing since the engines merged.
POST
/
api
/
tasks
Create Task Agent
curl --request POST \
--url https://app.tuco.ai/api/tasks \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"prompt": "<string>",
"includeTags": [
"<string>"
],
"excludeTags": [
"<string>"
],
"mode": "<string>",
"status": "<string>",
"connector": "<string>",
"kbRetrieval": "<string>",
"tone": "<string>",
"canAsk": true,
"typingIndicator": true,
"maxTurns": 123,
"onDoneTag": "<string>",
"writeTagToCrm": true,
"allowedToolIds": [
"<string>"
],
"collectFields": [
"<string>"
]
}
'import requests
url = "https://app.tuco.ai/api/tasks"
payload = {
"name": "<string>",
"prompt": "<string>",
"includeTags": ["<string>"],
"excludeTags": ["<string>"],
"mode": "<string>",
"status": "<string>",
"connector": "<string>",
"kbRetrieval": "<string>",
"tone": "<string>",
"canAsk": True,
"typingIndicator": True,
"maxTurns": 123,
"onDoneTag": "<string>",
"writeTagToCrm": True,
"allowedToolIds": ["<string>"],
"collectFields": ["<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>',
prompt: '<string>',
includeTags: ['<string>'],
excludeTags: ['<string>'],
mode: '<string>',
status: '<string>',
connector: '<string>',
kbRetrieval: '<string>',
tone: '<string>',
canAsk: true,
typingIndicator: true,
maxTurns: 123,
onDoneTag: '<string>',
writeTagToCrm: true,
allowedToolIds: ['<string>'],
collectFields: ['<string>']
})
};
fetch('https://app.tuco.ai/api/tasks', 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.tuco.ai/api/tasks",
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>',
'prompt' => '<string>',
'includeTags' => [
'<string>'
],
'excludeTags' => [
'<string>'
],
'mode' => '<string>',
'status' => '<string>',
'connector' => '<string>',
'kbRetrieval' => '<string>',
'tone' => '<string>',
'canAsk' => true,
'typingIndicator' => true,
'maxTurns' => 123,
'onDoneTag' => '<string>',
'writeTagToCrm' => true,
'allowedToolIds' => [
'<string>'
],
'collectFields' => [
'<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://app.tuco.ai/api/tasks"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"mode\": \"<string>\",\n \"status\": \"<string>\",\n \"connector\": \"<string>\",\n \"kbRetrieval\": \"<string>\",\n \"tone\": \"<string>\",\n \"canAsk\": true,\n \"typingIndicator\": true,\n \"maxTurns\": 123,\n \"onDoneTag\": \"<string>\",\n \"writeTagToCrm\": true,\n \"allowedToolIds\": [\n \"<string>\"\n ],\n \"collectFields\": [\n \"<string>\"\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://app.tuco.ai/api/tasks")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"prompt\": \"<string>\",\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"mode\": \"<string>\",\n \"status\": \"<string>\",\n \"connector\": \"<string>\",\n \"kbRetrieval\": \"<string>\",\n \"tone\": \"<string>\",\n \"canAsk\": true,\n \"typingIndicator\": true,\n \"maxTurns\": 123,\n \"onDoneTag\": \"<string>\",\n \"writeTagToCrm\": true,\n \"allowedToolIds\": [\n \"<string>\"\n ],\n \"collectFields\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.tuco.ai/api/tasks")
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 \"prompt\": \"<string>\",\n \"includeTags\": [\n \"<string>\"\n ],\n \"excludeTags\": [\n \"<string>\"\n ],\n \"mode\": \"<string>\",\n \"status\": \"<string>\",\n \"connector\": \"<string>\",\n \"kbRetrieval\": \"<string>\",\n \"tone\": \"<string>\",\n \"canAsk\": true,\n \"typingIndicator\": true,\n \"maxTurns\": 123,\n \"onDoneTag\": \"<string>\",\n \"writeTagToCrm\": true,\n \"allowedToolIds\": [\n \"<string>\"\n ],\n \"collectFields\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_bodyThis is an alias.
POST /api/tasks and
POST /api/goal-bots are the same route and take the
same body. The full field reference lives on
Create Goal Bot.Authentication
Pass your workspace API key as a Bearer token, or use a Clerk session token.Authorization: Bearer tuco_xxxxxxxxxxxxx
Request body
string
required
Display name. Blank returns
400 Name is required.string
required
The instructions the model runs on. Blank returns
400 Prompt is required.string[]
Tags that wake this agent. Defaults to
[].string[]
Tags that keep leads away from it. Defaults to
[].string
default:"autopilot"
autopilot, copilot, manual, or the legacy alias draft. An unrecognised value is stored
as copilot rather than rejected.string
default:"active"
active or paused. Pass "paused" to create it dormant, verify it, then flip it on.string
default:"calendly"
calendly or ghl_calendar.string
default:"always"
always or auto.string
Free-text tone hint.
boolean
default:"true"
Whether it may ask follow-up questions.
boolean
default:"true"
Send a typing signal before replying.
number
default:"8"
Reply cap per conversation. Clamped to 1–20.
string
Tag applied when the agent finishes.
boolean
default:"false"
Push
onDoneTag to the connected CRM too.string[]
Tool ids the agent may call.
string[]
Fields the agent should try to collect.
Example
curl -X POST "https://app.tuco.ai/api/tasks" \
-H "Authorization: Bearer tuco_xxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Demo follow-up",
"prompt": "You are Raj from Tuco. Book a 15-minute demo.",
"includeTags": ["demo-requested"],
"status": "paused"
}'
Success (200 OK)
{
"goalBot": { "_id": "6ac3ed5f71adb32c88d566df", "name": "Demo follow-up", "status": "paused" },
"taskAgent": { /* identical object */ }
}
Errors
| Status | When | Body |
|---|---|---|
400 | name blank | { "error": "Name is required" } |
400 | prompt blank | { "error": "Prompt is required" } |
400 | Key has no active workspace | { "error": "No active workspace" } |
401 | Missing or invalid API key | { "error": "Unauthorized" } |