Intelligence
Cancel a workspace-agent run
Requires the workspace-agent deployment, rollout and feature flag plus a current Tali/Aida access permission. Conversation resources require an active human participant in the same tenant; inaccessible resources are concealed. Active runs are marked cancelled, open interrupts are cancelled and workflow control delivery is queued. Already terminal runs return their current resource. client_id/actor_id are prohibited.
POST
/
admin
/
workspace-agent
/
runs
/
{run}
/
cancel
Cancel a workspace-agent run
curl --request POST \
--url https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel', 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://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"conversation_id": "<string>",
"audience_id": "<string>",
"audience_revision": 123,
"sequence": 123,
"next_event_sequence": 123,
"input_message_id": "<string>",
"ingress_receipt_id": "<string>",
"initiating_channel_binding_id": "<string>",
"initiating_channel_binding_generation": 123,
"agent_id": "<string>",
"agent_release_id": "<string>",
"root_run_id": "<string>",
"parent_run_id": "<string>",
"status": "<string>",
"dispatch_state": "<string>",
"workflow_id": "<string>",
"provider": "<string>",
"model": "<string>",
"terminal_outcome": "<string>",
"workflow_version": "<string>",
"workflow_build_id": "<string>",
"execution_policy_sha256": "<string>",
"provider_response_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"grounding": {},
"safety": {},
"usage": {
"latency_ms": 123,
"input_tokens": 123,
"cached_input_tokens": 123,
"output_tokens": 123,
"search_calls": 123,
"estimated_cost_micros": 123,
"reserved_cost_micros": 123,
"accounted_cost_micros": 123,
"provider_attempts": 123,
"unknown_usage_attempts": 123,
"fallback_count": 123,
"model_breakdown": {}
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Headers
Request key; replay the same key only with the same payload.
Path Parameters
Run.
Response
Cancel a workspace-agent run response.
Show child attributes
Show child attributes
⌘I
Cancel a workspace-agent run
curl --request POST \
--url https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Idempotency-Key: <idempotency-key>'import requests
url = "https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel"
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
fetch('https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel', 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://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/workspace-agent/runs/{run}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"conversation_id": "<string>",
"audience_id": "<string>",
"audience_revision": 123,
"sequence": 123,
"next_event_sequence": 123,
"input_message_id": "<string>",
"ingress_receipt_id": "<string>",
"initiating_channel_binding_id": "<string>",
"initiating_channel_binding_generation": 123,
"agent_id": "<string>",
"agent_release_id": "<string>",
"root_run_id": "<string>",
"parent_run_id": "<string>",
"status": "<string>",
"dispatch_state": "<string>",
"workflow_id": "<string>",
"provider": "<string>",
"model": "<string>",
"terminal_outcome": "<string>",
"workflow_version": "<string>",
"workflow_build_id": "<string>",
"execution_policy_sha256": "<string>",
"provider_response_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"grounding": {},
"safety": {},
"usage": {
"latency_ms": 123,
"input_tokens": 123,
"cached_input_tokens": 123,
"output_tokens": 123,
"search_calls": 123,
"estimated_cost_micros": 123,
"reserved_cost_micros": 123,
"accounted_cost_micros": 123,
"provider_attempts": 123,
"unknown_usage_attempts": 123,
"fallback_count": 123,
"model_breakdown": {}
}
}
}{
"message": "Unauthorized",
"status": "error"
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}