Delete agent
import requests
url = "https://api.diga.io/v1/agent/{agent_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.diga.io/v1/agent/{agent_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://api.diga.io/v1/agent/{agent_id} \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.diga.io/v1/agent/{agent_id}"
req, _ := http.NewRequest("DELETE", 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))
}{
"status": "error",
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Missing required permissions to delete agents"
}{
"status": "error",
"error_code": "AGENT_NOT_FOUND",
"message": "Agent 550e8400-e29b-41d4-a716-446655440000 not found"
}{
"status": "error",
"error_code": "PUBLISHED_AGENT_VERSION_DELETION",
"message": "Cannot delete agent 550e8400-e29b-41d4-a716-446655440000 with published versions"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"status": "error",
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Error: Internal Server Error"
}Agents
Delete agent
Delete an agent by ID. Cannot delete agents with published versions.
DELETE
/
v1
/
agent
/
{agent_id}
Delete agent
import requests
url = "https://api.diga.io/v1/agent/{agent_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.diga.io/v1/agent/{agent_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request DELETE \
--url https://api.diga.io/v1/agent/{agent_id} \
--header 'Authorization: Bearer <token>'package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.diga.io/v1/agent/{agent_id}"
req, _ := http.NewRequest("DELETE", 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))
}{
"status": "error",
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Missing required permissions to delete agents"
}{
"status": "error",
"error_code": "AGENT_NOT_FOUND",
"message": "Agent 550e8400-e29b-41d4-a716-446655440000 not found"
}{
"status": "error",
"error_code": "PUBLISHED_AGENT_VERSION_DELETION",
"message": "Cannot delete agent 550e8400-e29b-41d4-a716-446655440000 with published versions"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"status": "error",
"error_code": "INTERNAL_SERVER_ERROR",
"message": "Error: Internal Server Error"
}⌘I

