curl -X PUT "https://app.cotool.ai/api/agents/batch" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"items":[{"name":"string","description":"string","versionDescription":"string","systemPrompt":"string","toolNames":["string"],"toolSelectionMode":"manual","cliNames":["string"],"toolActionConfigs":null,"inputs":[{"type":"text","name":"string","description":"string","required":true}],"modelAlias":null,"contextDocs":[{"provider":"googleDocs","id":"string","name":"string","mimeType":"string"}],"tinesStoryImportId":"string","planningMode":"never","structuredOutputSchema":null,"persistentWorkspaceEnabled":true,"slackReplyScope":"anyone","tags":[null],"skills":[{"skillId":"string","skillVersionId":"string"}],"acceptanceCriteria":["string"],"id":"string"}]}'import requests
url = "https://app.cotool.ai/api/agents/batch"
payload = { "items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"versionDescription": "<string>",
"systemPrompt": "<string>",
"toolNames": ["<string>"],
"cliNames": ["<string>"],
"toolActionConfigs": [
{
"type": "<string>",
"allowedChannels": [
{
"id": "<string>",
"name": "<string>"
}
],
"hideAgentButton": True
}
],
"inputs": [
{
"name": "<string>",
"description": "<string>",
"required": True
}
],
"modelAlias": "<unknown>",
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
versionDescription: '<string>',
systemPrompt: '<string>',
toolNames: ['<string>'],
cliNames: ['<string>'],
toolActionConfigs: [
{
type: '<string>',
allowedChannels: [{id: '<string>', name: '<string>'}],
hideAgentButton: true
}
],
inputs: [{name: '<string>', description: '<string>', required: true}],
modelAlias: '<unknown>',
contextDocs: [{id: '<string>', name: '<string>', mimeType: '<string>'}],
tinesStoryImportId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
structuredOutputSchema: {
title: '<string>',
description: '<string>',
properties: {},
items: '<unknown>',
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/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.put("https://app.cotool.ai/api/agents/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"versionDescription\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"<string>\",\n \"allowedChannels\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"hideAgentButton\": true\n }\n ],\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true\n }\n ],\n \"modelAlias\": \"<unknown>\",\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 \"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 }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"versionDescription\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"<string>\",\n \"allowedChannels\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"hideAgentButton\": true\n }\n ],\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true\n }\n ],\n \"modelAlias\": \"<unknown>\",\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 \"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 }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"agents": [
{
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"description": "<string>",
"systemPrompt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>",
"toolNames": [
"<string>"
],
"toolActionConfigs": [
{
"type": "<string>",
"allowedChannels": [
{
"id": "<string>",
"name": "<string>"
}
],
"hideAgentButton": true
}
],
"inputs": [
{
"name": "<string>",
"description": "<string>",
"required": true
}
],
"modelAlias": "<unknown>",
"isBuiltIn": true,
"cliNames": [
"<string>"
],
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "<string>",
"triggerSummary": [
{
"id": "<string>",
"name": "<string>",
"enabled": true,
"createsAlert": true
}
],
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"required": [
"<string>"
],
"enum": [
"<string>"
],
"additionalProperties": true,
"x-cotool": {
"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>"
],
"syncKey": "<string>",
"syncSource": "<string>",
"syncFilePath": "<string>",
"syncConfigId": "<string>",
"detectionQuery": "<string>",
"siemType": "<string>",
"isSuggestion": true,
"lastDetectionRunAt": "<string>"
}
]
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Batch update agents
Atomically update many agents in a single SERIALIZABLE transaction. The entire batch succeeds or rolls back together; this avoids partial-failure modes seen when issuing many concurrent single-agent updates that conflict on the same rows.
curl -X PUT "https://app.cotool.ai/api/agents/batch" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"items":[{"name":"string","description":"string","versionDescription":"string","systemPrompt":"string","toolNames":["string"],"toolSelectionMode":"manual","cliNames":["string"],"toolActionConfigs":null,"inputs":[{"type":"text","name":"string","description":"string","required":true}],"modelAlias":null,"contextDocs":[{"provider":"googleDocs","id":"string","name":"string","mimeType":"string"}],"tinesStoryImportId":"string","planningMode":"never","structuredOutputSchema":null,"persistentWorkspaceEnabled":true,"slackReplyScope":"anyone","tags":[null],"skills":[{"skillId":"string","skillVersionId":"string"}],"acceptanceCriteria":["string"],"id":"string"}]}'import requests
url = "https://app.cotool.ai/api/agents/batch"
payload = { "items": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"versionDescription": "<string>",
"systemPrompt": "<string>",
"toolNames": ["<string>"],
"cliNames": ["<string>"],
"toolActionConfigs": [
{
"type": "<string>",
"allowedChannels": [
{
"id": "<string>",
"name": "<string>"
}
],
"hideAgentButton": True
}
],
"inputs": [
{
"name": "<string>",
"description": "<string>",
"required": True
}
],
"modelAlias": "<unknown>",
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"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.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
name: '<string>',
description: '<string>',
versionDescription: '<string>',
systemPrompt: '<string>',
toolNames: ['<string>'],
cliNames: ['<string>'],
toolActionConfigs: [
{
type: '<string>',
allowedChannels: [{id: '<string>', name: '<string>'}],
hideAgentButton: true
}
],
inputs: [{name: '<string>', description: '<string>', required: true}],
modelAlias: '<unknown>',
contextDocs: [{id: '<string>', name: '<string>', mimeType: '<string>'}],
tinesStoryImportId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
structuredOutputSchema: {
title: '<string>',
description: '<string>',
properties: {},
items: '<unknown>',
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/batch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.put("https://app.cotool.ai/api/agents/batch")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"items\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"versionDescription\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"<string>\",\n \"allowedChannels\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"hideAgentButton\": true\n }\n ],\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true\n }\n ],\n \"modelAlias\": \"<unknown>\",\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 \"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 }\n ]\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/batch"
payload := strings.NewReader("{\n \"items\": [\n {\n \"id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"versionDescription\": \"<string>\",\n \"systemPrompt\": \"<string>\",\n \"toolNames\": [\n \"<string>\"\n ],\n \"cliNames\": [\n \"<string>\"\n ],\n \"toolActionConfigs\": [\n {\n \"type\": \"<string>\",\n \"allowedChannels\": [\n {\n \"id\": \"<string>\",\n \"name\": \"<string>\"\n }\n ],\n \"hideAgentButton\": true\n }\n ],\n \"inputs\": [\n {\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"required\": true\n }\n ],\n \"modelAlias\": \"<unknown>\",\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 \"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 }\n ]\n}")
req, _ := http.NewRequest("PUT", 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))
}{
"agents": [
{
"id": "<string>",
"organizationId": "<string>",
"name": "<string>",
"description": "<string>",
"systemPrompt": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"deletedAt": "<string>",
"toolNames": [
"<string>"
],
"toolActionConfigs": [
{
"type": "<string>",
"allowedChannels": [
{
"id": "<string>",
"name": "<string>"
}
],
"hideAgentButton": true
}
],
"inputs": [
{
"name": "<string>",
"description": "<string>",
"required": true
}
],
"modelAlias": "<unknown>",
"isBuiltIn": true,
"cliNames": [
"<string>"
],
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"tinesStoryImportId": "<string>",
"triggerSummary": [
{
"id": "<string>",
"name": "<string>",
"enabled": true,
"createsAlert": true
}
],
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"required": [
"<string>"
],
"enum": [
"<string>"
],
"additionalProperties": true,
"x-cotool": {
"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>"
],
"syncKey": "<string>",
"syncSource": "<string>",
"syncFilePath": "<string>",
"syncConfigId": "<string>",
"detectionQuery": "<string>",
"siemType": "<string>",
"isSuggestion": true,
"lastDetectionRunAt": "<string>"
}
]
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Authorizations
API Key authentication for programmatic access. Include your API key in the Authorization header as: Bearer your_api_key_here
Body
Atomically update many agents in a single transaction. The entire batch succeeds or rolls back together.
Per-agent update payloads. The whole batch is applied in a single transaction.
1 - 200 elementsShow child attributes
Show child attributes
Response
Successful response
Updated agents from a batch update.
The updated agents, in the same order as the request items. Items whose agent could not be found or read after update are omitted.
Agent configuration - can be either a built in (system-managed) or custom (user-created) agent
- Option 1
- Option 2
Show child attributes
Show child attributes
Was this page helpful?