cURL
curl -X POST "https://app.cotool.ai/api/agents/:agentId/versions/:versionId/revert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"import requests
url = "https://app.cotool.ai/api/agents/{agentId}/versions/{versionId}/revert"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cotool.ai/api/agents/{agentId}/versions/{versionId}/revert', 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/{agentId}/versions/{versionId}/revert")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/versions/{versionId}/revert"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition": {
"name": "<string>",
"modelAlias": "<unknown>",
"systemPrompt": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"agentFilesystem": true,
"toolNames": [
"<string>"
],
"toolActionConfigs": [
{
"type": "<string>",
"allowedChannels": [
{
"id": "<string>",
"name": "<string>"
}
],
"hideAgentButton": true
}
],
"agentTools": [
{
"sync_key": "<string>"
}
],
"cliNames": [
"<string>"
],
"skills": [
"<string>"
],
"inputs": [
{
"name": "<string>",
"description": "<string>",
"required": true
}
],
"acceptanceCriteria": [
"<string>"
],
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"triggers": [
{
"name": "<string>",
"sync_key": "<string>",
"description": "<string>",
"enabled": true,
"schedule": "<string>",
"events": [
"<string>"
],
"jqlFilter": "<string>",
"issuePropertyKeysFilter": [
"<string>"
],
"fieldIdsFilter": [
"<string>"
],
"allowedChannelIds": [
"<string>"
],
"allowedUserIds": [
"<string>"
],
"allowedUsergroupIds": [
"<string>"
],
"resourceTypes": [
"<string>"
],
"emailAddress": "<string>"
}
],
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"required": [
"<string>"
],
"enum": [
"<string>"
],
"additionalProperties": true,
"x-cotool": {
"viewerId": "<string>"
}
},
"syncKey": "<string>"
},
"sourceCommitSha": "<string>",
"changedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changedByEmail": "<string>",
"description": "<string>",
"createdAt": "<string>"
}{
"error": "<string>",
"issues": [
{}
]
}{
"error": "<string>"
}{
"error": "<string>",
"missingPerms": [
"<string>"
]
}{
"error": "<string>"
}Agent Versions
Revert an agent to a previous version
Re-applies a previously-recorded version’s whole-definition snapshot (prompt + spec + tags + skills) onto the live agent, recording a new head version equal to the chosen one. Requires agent.edit.
POST
/
api
/
agents
/
{agentId}
/
versions
/
{versionId}
/
revert
cURL
curl -X POST "https://app.cotool.ai/api/agents/:agentId/versions/:versionId/revert" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"import requests
url = "https://app.cotool.ai/api/agents/{agentId}/versions/{versionId}/revert"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.cotool.ai/api/agents/{agentId}/versions/{versionId}/revert', 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/{agentId}/versions/{versionId}/revert")
.header("Authorization", "Bearer <token>")
.asString();package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.cotool.ai/api/agents/{agentId}/versions/{versionId}/revert"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"agentId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"definition": {
"name": "<string>",
"modelAlias": "<unknown>",
"systemPrompt": "<string>",
"description": "<string>",
"tags": [
"<string>"
],
"agentFilesystem": true,
"toolNames": [
"<string>"
],
"toolActionConfigs": [
{
"type": "<string>",
"allowedChannels": [
{
"id": "<string>",
"name": "<string>"
}
],
"hideAgentButton": true
}
],
"agentTools": [
{
"sync_key": "<string>"
}
],
"cliNames": [
"<string>"
],
"skills": [
"<string>"
],
"inputs": [
{
"name": "<string>",
"description": "<string>",
"required": true
}
],
"acceptanceCriteria": [
"<string>"
],
"contextDocs": [
{
"id": "<string>",
"name": "<string>",
"mimeType": "<string>"
}
],
"triggers": [
{
"name": "<string>",
"sync_key": "<string>",
"description": "<string>",
"enabled": true,
"schedule": "<string>",
"events": [
"<string>"
],
"jqlFilter": "<string>",
"issuePropertyKeysFilter": [
"<string>"
],
"fieldIdsFilter": [
"<string>"
],
"allowedChannelIds": [
"<string>"
],
"allowedUserIds": [
"<string>"
],
"allowedUsergroupIds": [
"<string>"
],
"resourceTypes": [
"<string>"
],
"emailAddress": "<string>"
}
],
"structuredOutputSchema": {
"title": "<string>",
"description": "<string>",
"properties": {},
"items": "<unknown>",
"required": [
"<string>"
],
"enum": [
"<string>"
],
"additionalProperties": true,
"x-cotool": {
"viewerId": "<string>"
}
},
"syncKey": "<string>"
},
"sourceCommitSha": "<string>",
"changedByUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changedByEmail": "<string>",
"description": "<string>",
"createdAt": "<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
Response
Successful response
Show child attributes
Show child attributes
Available options:
user, sync Was this page helpful?
⌘I