cURL
curl -X POST "https://app.cotool.ai/api/agents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","description":"string","systemPrompt":"string","toolNames":["string"],"toolSelectionMode":"manual","cliNames":["string"],"toolActionConfigs":null,"modelAlias":null,"reasoningEffort":"none","fastMode":true,"contextDocs":[{"provider":"googleDocs","id":"string","name":"string","mimeType":"string"}],"tinesStoryImportId":"string","planningMode":"never","structuredOutputSchema":null,"persistentWorkspaceEnabled":true,"tags":[null],"skills":[{"skillId":"string","skillVersionId":"string"}],"acceptanceCriteria":["string"]}'import requests
url = "https://app.cotool.ai/api/agents"
payload = {
"name": "<string>",
"description": "<string>",
"systemPrompt": "<string>",
"toolNames": ["<string>"],
"modelAlias": "<unknown>",
"cliNames": ["<string>"],
"toolActionConfigs": [
{
"type": "cotool-email_sendEmail",
"allowedRecipients": ["<string>"]
}
],
"fastMode": True,
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"minItems": 1,
"maxItems": 1,
"required": ["<string>"],
"enum": ["<string>"],
"additionalProperties": True,
"x-cotool": { "viewerId": "<string>" }
},
"persistentWorkspaceEnabled": True,
"tags": ["<string>"],
"skills": [
{
"skillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"skillVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"acceptanceCriteria": ["<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>',
description: '<string>',
systemPrompt: '<string>',
toolNames: ['<string>'],
modelAlias: '<unknown>',
cliNames: ['<string>'],
toolActionConfigs: [{type: 'cotool-email_sendEmail', allowedRecipients: ['<string>']}],
fastMode: true,
contextDocs: [{id: '<string>', name: '<string>', mimeType: '<string>'}],
tinesStoryImportId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
structuredOutputSchema: {
title: '<string>',
description: '<string>',
properties: {},
items: '<unknown>',
minItems: 1,
maxItems: 1,
required: ['<string>'],
enum: ['<string>'],
additionalProperties: true,
'x-cotool': {viewerId: '<string>'}
},
persistentWorkspaceEnabled: true,
tags: ['<string>'],
skills: [
{
skillId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
skillVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
acceptanceCriteria: ['<string>']
})
};
fetch('https://app.cotool.ai/api/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://app.cotool.ai/api/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"modelAlias\": \"<unknown>\",\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"cotool-email_sendEmail\",\n \"allowedRecipients\": [\n \"<string>\"\n ]\n }\n ],\n \"fastMode\": true,\n \"contextDocs\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ],\n \"tinesStoryImportId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"structuredOutputSchema\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"properties\": {},\n \"items\": \"<unknown>\",\n \"minItems\": 1,\n \"maxItems\": 1,\n \"required\": [\n \"<string>\"\n ],\n \"enum\": [\n \"<string>\"\n ],\n \"additionalProperties\": true,\n \"x-cotool\": {\n \"viewerId\": \"<string>\"\n }\n },\n \"persistentWorkspaceEnabled\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"skills\": [\n {\n \"skillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"skillVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"acceptanceCriteria\": [\n \"<string>\"\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"modelAlias\": \"<unknown>\",\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"cotool-email_sendEmail\",\n \"allowedRecipients\": [\n \"<string>\"\n ]\n }\n ],\n \"fastMode\": true,\n \"contextDocs\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ],\n \"tinesStoryImportId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"structuredOutputSchema\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"properties\": {},\n \"items\": \"<unknown>\",\n \"minItems\": 1,\n \"maxItems\": 1,\n \"required\": [\n \"<string>\"\n ],\n \"enum\": [\n \"<string>\"\n ],\n \"additionalProperties\": true,\n \"x-cotool\": {\n \"viewerId\": \"<string>\"\n }\n },\n \"persistentWorkspaceEnabled\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"skills\": [\n {\n \"skillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"skillVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"acceptanceCriteria\": [\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))
}{
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"description": "<string>",
"systemPrompt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>",
"toolNames": [
"<string>"
],
"toolSelectionMode": "manual",
"toolActionConfigs": [
{
"type": "cotool-email_sendEmail",
"allowedRecipients": [
"<string>"
]
}
],
"modelAlias": "<unknown>",
"planningMode": "auto",
"agentType": "response",
"origin": "user",
"isBuiltIn": true,
"builtInAgentType": "threat-relevancy",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"createdBy": {
"name": "<string>",
"imageUrl": "<string>"
},
"updatedBy": {
"name": "<string>",
"imageUrl": "<string>"
},
"invocationCount": 1,
"invocationCount30d": 1,
"lastInvokedAt": "<string>",
"cliNames": [
"<string>"
],
"reasoningEffort": "none",
"fastMode": true,
"contextDocs": [
{
"provider": "googleDocs",
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "<string>",
"triggerSummary": [
{
"id": "<string>",
"source": "jira",
"name": "<string>",
"enabled": true,
"eventMode": "direct",
"createsAlert": true
}
],
"structuredOutputSchema": {
"type": "string",
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"minItems": 1,
"maxItems": 1,
"required": [
"<string>"
],
"enum": [
"<string>"
],
"additionalProperties": true,
"x-cotool": {
"presetId": "classification",
"viewerId": "<string>"
}
},
"persistentWorkspaceEnabled": true,
"tags": [
"<string>"
],
"skills": [
{
"skillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"skill": {
"name": "<string>",
"description": "<string>",
"requiredTools": [
"<string>"
]
},
"skillVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invocationCount30d": 123
}
],
"acceptanceCriteria": [
"<string>"
],
"slackReplyScope": "anyone",
"syncKey": "<string>",
"syncSource": "<string>",
"syncFilePath": "<string>",
"syncConfigId": "<string>",
"syncSourceUrl": "<string>",
"detectionCategory": "baseline_anomaly",
"detectionQuery": "<string>",
"siemType": "<string>",
"isSuggestion": true,
"lastDetectionRunAt": "<string>",
"legacyDetection": true
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Agents
Create a new agent
Create a new AI agent with specified configuration including system prompt, tools, and model settings
POST
/
api
/
agents
cURL
curl -X POST "https://app.cotool.ai/api/agents" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"string","description":"string","systemPrompt":"string","toolNames":["string"],"toolSelectionMode":"manual","cliNames":["string"],"toolActionConfigs":null,"modelAlias":null,"reasoningEffort":"none","fastMode":true,"contextDocs":[{"provider":"googleDocs","id":"string","name":"string","mimeType":"string"}],"tinesStoryImportId":"string","planningMode":"never","structuredOutputSchema":null,"persistentWorkspaceEnabled":true,"tags":[null],"skills":[{"skillId":"string","skillVersionId":"string"}],"acceptanceCriteria":["string"]}'import requests
url = "https://app.cotool.ai/api/agents"
payload = {
"name": "<string>",
"description": "<string>",
"systemPrompt": "<string>",
"toolNames": ["<string>"],
"modelAlias": "<unknown>",
"cliNames": ["<string>"],
"toolActionConfigs": [
{
"type": "cotool-email_sendEmail",
"allowedRecipients": ["<string>"]
}
],
"fastMode": True,
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"minItems": 1,
"maxItems": 1,
"required": ["<string>"],
"enum": ["<string>"],
"additionalProperties": True,
"x-cotool": { "viewerId": "<string>" }
},
"persistentWorkspaceEnabled": True,
"tags": ["<string>"],
"skills": [
{
"skillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"skillVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
],
"acceptanceCriteria": ["<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>',
description: '<string>',
systemPrompt: '<string>',
toolNames: ['<string>'],
modelAlias: '<unknown>',
cliNames: ['<string>'],
toolActionConfigs: [{type: 'cotool-email_sendEmail', allowedRecipients: ['<string>']}],
fastMode: true,
contextDocs: [{id: '<string>', name: '<string>', mimeType: '<string>'}],
tinesStoryImportId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
structuredOutputSchema: {
title: '<string>',
description: '<string>',
properties: {},
items: '<unknown>',
minItems: 1,
maxItems: 1,
required: ['<string>'],
enum: ['<string>'],
additionalProperties: true,
'x-cotool': {viewerId: '<string>'}
},
persistentWorkspaceEnabled: true,
tags: ['<string>'],
skills: [
{
skillId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
skillVersionId: '3c90c3cc-0d44-4b50-8888-8dd25736052a'
}
],
acceptanceCriteria: ['<string>']
})
};
fetch('https://app.cotool.ai/api/agents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.post("https://app.cotool.ai/api/agents")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"modelAlias\": \"<unknown>\",\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"cotool-email_sendEmail\",\n \"allowedRecipients\": [\n \"<string>\"\n ]\n }\n ],\n \"fastMode\": true,\n \"contextDocs\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ],\n \"tinesStoryImportId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"structuredOutputSchema\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"properties\": {},\n \"items\": \"<unknown>\",\n \"minItems\": 1,\n \"maxItems\": 1,\n \"required\": [\n \"<string>\"\n ],\n \"enum\": [\n \"<string>\"\n ],\n \"additionalProperties\": true,\n \"x-cotool\": {\n \"viewerId\": \"<string>\"\n }\n },\n \"persistentWorkspaceEnabled\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"skills\": [\n {\n \"skillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"skillVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"acceptanceCriteria\": [\n \"<string>\"\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"modelAlias\": \"<unknown>\",\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"cotool-email_sendEmail\",\n \"allowedRecipients\": [\n \"<string>\"\n ]\n }\n ],\n \"fastMode\": true,\n \"contextDocs\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\",\n \"mimeType\": \"<string>\"\n }\n ],\n \"tinesStoryImportId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"structuredOutputSchema\": {\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"properties\": {},\n \"items\": \"<unknown>\",\n \"minItems\": 1,\n \"maxItems\": 1,\n \"required\": [\n \"<string>\"\n ],\n \"enum\": [\n \"<string>\"\n ],\n \"additionalProperties\": true,\n \"x-cotool\": {\n \"viewerId\": \"<string>\"\n }\n },\n \"persistentWorkspaceEnabled\": true,\n \"tags\": [\n \"<string>\"\n ],\n \"skills\": [\n {\n \"skillId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"skillVersionId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n }\n ],\n \"acceptanceCriteria\": [\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))
}{
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"description": "<string>",
"systemPrompt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>",
"toolNames": [
"<string>"
],
"toolSelectionMode": "manual",
"toolActionConfigs": [
{
"type": "cotool-email_sendEmail",
"allowedRecipients": [
"<string>"
]
}
],
"modelAlias": "<unknown>",
"planningMode": "auto",
"agentType": "response",
"origin": "user",
"isBuiltIn": true,
"builtInAgentType": "threat-relevancy",
"createdByUserId": "<string>",
"updatedByUserId": "<string>",
"createdBy": {
"name": "<string>",
"imageUrl": "<string>"
},
"updatedBy": {
"name": "<string>",
"imageUrl": "<string>"
},
"invocationCount": 1,
"invocationCount30d": 1,
"lastInvokedAt": "<string>",
"cliNames": [
"<string>"
],
"reasoningEffort": "none",
"fastMode": true,
"contextDocs": [
{
"provider": "googleDocs",
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "<string>",
"triggerSummary": [
{
"id": "<string>",
"source": "jira",
"name": "<string>",
"enabled": true,
"eventMode": "direct",
"createsAlert": true
}
],
"structuredOutputSchema": {
"type": "string",
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"minItems": 1,
"maxItems": 1,
"required": [
"<string>"
],
"enum": [
"<string>"
],
"additionalProperties": true,
"x-cotool": {
"presetId": "classification",
"viewerId": "<string>"
}
},
"persistentWorkspaceEnabled": true,
"tags": [
"<string>"
],
"skills": [
{
"skillId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"skill": {
"name": "<string>",
"description": "<string>",
"requiredTools": [
"<string>"
]
},
"skillVersionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"invocationCount30d": 123
}
],
"acceptanceCriteria": [
"<string>"
],
"slackReplyScope": "anyone",
"syncKey": "<string>",
"syncSource": "<string>",
"syncFilePath": "<string>",
"syncConfigId": "<string>",
"syncSourceUrl": "<string>",
"detectionCategory": "baseline_anomaly",
"detectionQuery": "<string>",
"siemType": "<string>",
"isSuggestion": true,
"lastDetectionRunAt": "<string>",
"legacyDetection": true
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>",
"code": "<string>",
"details": {}
}Authorizations
Body
application/json
Request body for creating a new AI agent with configuration
Response
Successful response
- Option 1
- Option 2
The newly created agent with generated ID and timestamps
Was this page helpful?
⌘I