curl --request POST \
--url https://api.veryfront.com/runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.veryfront.com/runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.veryfront.com/runs/{run_id}/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.veryfront.com/runs/{run_id}/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>"
],
]);
$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.veryfront.com/runs/{run_id}/cancel"
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))
}HttpResponse<String> response = Unirest.post("https://api.veryfront.com/runs/{run_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/runs/{run_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cancelled": true,
"run": {
"run_id": "<string>",
"id": "<string>",
"kind": "agent",
"status": "pending",
"owner": {
"kind": "conversation",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"usage": {
"requests": 1,
"model_calls": 1,
"input_tokens": 1,
"output_tokens": 1,
"cache_creation_input_tokens": 1,
"cache_read_input_tokens": 1,
"reasoning_tokens": 1,
"total_tokens": 1,
"cost_credits": "<string>"
},
"tool_error_count": 1,
"children_failed": true,
"parent_run_id": "<string>",
"root_run_id": "<string>",
"waiting_reason": "tool",
"waiting_on": [
{
"kind": "run",
"run_id": "<string>",
"correlation": {
"kind": "tool_call",
"id": "<string>"
}
}
],
"waiting": {
"reason": "tool",
"on": [
{
"kind": "run",
"run_id": "<string>",
"correlation": {
"kind": "tool_call",
"id": "<string>"
}
}
],
"pending_approvals": [
"<string>"
],
"resume_at": "2023-11-07T05:31:56Z"
},
"cancellation": {
"requested_at": "<string>",
"stopped_at": "<string>"
},
"pause": {
"requested_at": "<string>"
},
"title": "<string>",
"target": "<string>",
"workflow_id": "<string>",
"schedule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runtime_target_kind": "main_branch",
"runtime_target_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runtime_target_branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error": {
"message": "<string>",
"code": "<string>"
},
"logs": "<string>",
"artifacts": [
"<unknown>"
],
"duration_ms": 123,
"exit_code": 123,
"start_mode": "<string>",
"timeout_seconds": 123,
"backoff_limit": 123,
"input_schema_sha256": "<string>",
"output_schema_sha256": "<string>",
"input_schema_hash": "<string>",
"output_schema_hash": "<string>",
"trigger": {
"kind": "manual",
"id": "<string>",
"principal": {
"kind": "system",
"id": "<string>"
}
},
"trigger_kind": "manual",
"trigger_id": "<string>",
"created_by": "<string>",
"updated_at": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"metadata": "<unknown>",
"control": {
"pause": {
"requested_at": "2023-11-07T05:31:56Z"
},
"waiting": {
"reason": "manual_pause",
"resume_at": "2023-11-07T05:31:56Z"
}
},
"input": "<unknown>",
"config": "<unknown>",
"output": "<unknown>",
"trigger_principal_type": "system",
"trigger_principal_id": "<string>"
}
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}Cancel run
Cancels an agent, workflow or task run and every active descendant, and returns the run. Requires editor access to every affected run owner. Cookie authentication also requires application/json or application/graphql-response+json and a trusted browser Origin. Eval runs cannot be cancelled here.
One transaction records run.cancellation.requested_at on the run and each active descendant and ends them cancelled, so no new child is admitted under any of them. Finished descendants, ancestors and siblings keep their outcome. cancelled is true when the run ends cancelled; repeating the cancel returns the same run. A run that already completed or failed returns 409 RUN_TERMINAL_CONFLICT. stopped_at is set once the runtime confirms the stop and stays null while it is unconfirmed; null does not mean the run is still executing.
curl --request POST \
--url https://api.veryfront.com/runs/{run_id}/cancel \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.veryfront.com/runs/{run_id}/cancel"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.veryfront.com/runs/{run_id}/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.veryfront.com/runs/{run_id}/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>"
],
]);
$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.veryfront.com/runs/{run_id}/cancel"
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))
}HttpResponse<String> response = Unirest.post("https://api.veryfront.com/runs/{run_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.veryfront.com/runs/{run_id}/cancel")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"cancelled": true,
"run": {
"run_id": "<string>",
"id": "<string>",
"kind": "agent",
"status": "pending",
"owner": {
"kind": "conversation",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
},
"project_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"conversation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"message_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"usage": {
"requests": 1,
"model_calls": 1,
"input_tokens": 1,
"output_tokens": 1,
"cache_creation_input_tokens": 1,
"cache_read_input_tokens": 1,
"reasoning_tokens": 1,
"total_tokens": 1,
"cost_credits": "<string>"
},
"tool_error_count": 1,
"children_failed": true,
"parent_run_id": "<string>",
"root_run_id": "<string>",
"waiting_reason": "tool",
"waiting_on": [
{
"kind": "run",
"run_id": "<string>",
"correlation": {
"kind": "tool_call",
"id": "<string>"
}
}
],
"waiting": {
"reason": "tool",
"on": [
{
"kind": "run",
"run_id": "<string>",
"correlation": {
"kind": "tool_call",
"id": "<string>"
}
}
],
"pending_approvals": [
"<string>"
],
"resume_at": "2023-11-07T05:31:56Z"
},
"cancellation": {
"requested_at": "<string>",
"stopped_at": "<string>"
},
"pause": {
"requested_at": "<string>"
},
"title": "<string>",
"target": "<string>",
"workflow_id": "<string>",
"schedule_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"batch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runtime_target_kind": "main_branch",
"runtime_target_environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"runtime_target_branch_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"error": {
"message": "<string>",
"code": "<string>"
},
"logs": "<string>",
"artifacts": [
"<unknown>"
],
"duration_ms": 123,
"exit_code": 123,
"start_mode": "<string>",
"timeout_seconds": 123,
"backoff_limit": 123,
"input_schema_sha256": "<string>",
"output_schema_sha256": "<string>",
"input_schema_hash": "<string>",
"output_schema_hash": "<string>",
"trigger": {
"kind": "manual",
"id": "<string>",
"principal": {
"kind": "system",
"id": "<string>"
}
},
"trigger_kind": "manual",
"trigger_id": "<string>",
"created_by": "<string>",
"updated_at": "<string>",
"created_at": "<string>",
"started_at": "<string>",
"completed_at": "<string>",
"metadata": "<unknown>",
"control": {
"pause": {
"requested_at": "2023-11-07T05:31:56Z"
},
"waiting": {
"reason": "manual_pause",
"resume_at": "2023-11-07T05:31:56Z"
}
},
"input": "<unknown>",
"config": "<unknown>",
"output": "<unknown>",
"trigger_principal_type": "system",
"trigger_principal_id": "<string>"
}
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}{
"type": "https://api.veryfront.com/errors/validation-failed",
"title": "Validation Failed",
"status": 400,
"idempotency": {
"state": "in_progress",
"operation": "<string>",
"retryable": true,
"retry_after_seconds": 1,
"expires_at": "<string>",
"recovery": {
"available": true,
"description": "<string>",
"resource_url": "<string>"
}
},
"code": "RUN_INVALID_INPUT",
"detail": "The 'email' field must be a valid email address",
"instance": "/projects/my-project/members",
"slug": "validation-failed",
"category": "VALIDATION",
"suggestion": "Check the request body and query parameters against the API documentation.",
"errors": [
{
"field": "email",
"message": "Invalid email format",
"code": "INVALID_FORMAT"
}
]
}