POST /v1/agent-runs/{id}/cancel
Requests cancellation of a running agent run. Cancellation is asynchronous — poll GET /v1/agent-runs/{id} to observe the terminal "cancelled" phase.

Authentication

API Key (header: Authorization)

Path Parameters

id string required path
Run ID

Responses

200 OK
application/json
code integer
data object
ok boolean
message string
requestId string
curl -X POST 'https://api.example.com/v1/agent-runs/string/cancel' \  -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://api.example.com/v1/agent-runs/string/cancel', {  method: 'POST',  headers: {      "Authorization": "Bearer YOUR_API_TOKEN"  }});const data = await response.json();console.log(data);
import requestsheaders = {    'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.post('https://api.example.com/v1/agent-runs/string/cancel', headers=headers)print(response.json())
package mainimport (	"fmt"	"io"	"net/http")func main() {	req, _ := http.NewRequest("POST", "https://api.example.com/v1/agent-runs/string/cancel", nil)	req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")	resp, _ := http.DefaultClient.Do(req)	defer resp.Body.Close()	result, _ := io.ReadAll(resp.Body)	fmt.Println(string(result))}
200 Response
{  "code": 200,  "data": {    "ok": true  },  "message": "success",  "requestId": "abc-123"}