Cancel agent
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel"
payload = {}
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({})
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/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.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel"
payload := strings.NewReader("{}")
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))
}HttpResponse<String> response = Unirest.post("https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"event": {
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"agent_id": "<string>",
"turn_id": "<string>",
"turn_sequence": 4503599627370496,
"is_opening_event": true,
"sequence": 4503599627370496,
"event_kind": "agent_input",
"agent_input_id": "<string>",
"input_kind": "content",
"content_blocks": [
{
"type": "text",
"text": "<string>",
"metadata": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"actor_id": "<string>",
"input_idempotency_key": "<string>",
"control_type": "cancel_current",
"interaction_id": "<string>",
"agent_config_id": "<string>"
},
"runtime_cancel_requested": true,
"affected": true,
"actor_id": "<string>"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "internal_error"
}Agents
Cancel agent
POST
/
orgs
/
{orgID}
/
projects
/
{projectID}
/
agents
/
{agentID}
/
cancel
Cancel agent
curl --request POST \
--url https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'import requests
url = "https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel"
payload = {}
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({})
};
fetch('https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/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.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel"
payload := strings.NewReader("{}")
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))
}HttpResponse<String> response = Unirest.post("https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.omnara.com/v1/orgs/{orgID}/projects/{projectID}/agents/{agentID}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{}"
response = http.request(request)
puts response.read_body{
"event": {
"id": "<string>",
"org_id": "<string>",
"project_id": "<string>",
"agent_id": "<string>",
"turn_id": "<string>",
"turn_sequence": 4503599627370496,
"is_opening_event": true,
"sequence": 4503599627370496,
"event_kind": "agent_input",
"agent_input_id": "<string>",
"input_kind": "content",
"content_blocks": [
{
"type": "text",
"text": "<string>",
"metadata": {}
}
],
"created_at": "2023-11-07T05:31:56Z",
"actor_id": "<string>",
"input_idempotency_key": "<string>",
"control_type": "cancel_current",
"interaction_id": "<string>",
"agent_config_id": "<string>"
},
"runtime_cancel_requested": true,
"affected": true,
"actor_id": "<string>"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "invalid_request"
}{
"error": "<string>",
"code": "internal_error"
}Authorizations
bearerAuthbrowserSessionCookie & csrfHeader
An opaque Omnara personal or organization bearer token.
Path Parameters
Pattern:
^org_[a-z2-7]{26}$Pattern:
^proj_[a-z2-7]{26}$Pattern:
^agt_[a-z2-7]{26}$Body
application/json
External actor to attribute this cancelation to, upserted by (provider_tenant_id, provider_user_id) atomically with the cancelation; a rejected request writes no actor. Only allowed for non-user principals; requests authenticated as a user must omit it and are attributed to the user's omnara actor.
Show child attributes
Show child attributes
Response
Agent canceled.
- Option 1
- Option 2
- Option 3
- Option 4
Show child attributes
Show child attributes
Whether this request created or observed a durable runtime cancel request. Immediate delivery is best effort; runtime-lock renewal observes the durable request.
Whether this request changed any cancelable work.
Actor the cancelation was attributed to. Absent when the request had no actor attribution.
Pattern:
^actr_[a-z2-7]{26}$⌘I