cURL
curl -X POST \
-H 'Authorization: Bearer $JWT_TOKEN' \
-H 'Accept: application/json' \
'$BASE_URL/cancel/{TEAM_ID}/{RUN_ID}'import requests
headers = {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Accept': 'application/json'
}
resp = requests.post(
f"https://example.com/cancel/{{TEAM_ID}}/{{RUN_ID}}",
headers=headers
)
print(resp.status_code, resp.json())fetch(`https://example.com/cancel/${TEAM_ID}/${RUN_ID}`, {
method: 'POST',
headers: {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Accept': 'application/json'
}
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));// Using HttpClient
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "<YOUR_API_KEY>");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "<YOUR_JWT_TOKEN>");
var response = await client.PostAsync("https://example.com/cancel/{TEAM_ID}/{RUN_ID}", null);
string content = await response.Content.ReadAsStringAsync();
Console.WriteLine(response.StatusCode);
Console.WriteLine(content);{
"message": "Run successfully canceled."
}{
"description": "Bad Request. Possibly invalid team_id/run_id format."
}{
"description": "Unauthorized. The Bearer token or API key is invalid or missing."
}{
"description": "Payment Required. Subscription not active or no credits available."
}{
"description": "Forbidden. You do not have permission to cancel this run."
}{
"description": "Not Found. The run or team was not found."
}{
"description": "Internal Server Error. Something went wrong on the server."
}Workflows
Cancel Workflow Run
Cancels an ongoing workflow run
POST
/
cancel
/
{team_id}
/
{run_id}
cURL
curl -X POST \
-H 'Authorization: Bearer $JWT_TOKEN' \
-H 'Accept: application/json' \
'$BASE_URL/cancel/{TEAM_ID}/{RUN_ID}'import requests
headers = {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Accept': 'application/json'
}
resp = requests.post(
f"https://example.com/cancel/{{TEAM_ID}}/{{RUN_ID}}",
headers=headers
)
print(resp.status_code, resp.json())fetch(`https://example.com/cancel/${TEAM_ID}/${RUN_ID}`, {
method: 'POST',
headers: {
'x-api-key': '<YOUR_API_KEY>',
'Authorization': 'Bearer <YOUR_JWT_TOKEN>',
'Accept': 'application/json'
}
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));// Using HttpClient
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("x-api-key", "<YOUR_API_KEY>");
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "<YOUR_JWT_TOKEN>");
var response = await client.PostAsync("https://example.com/cancel/{TEAM_ID}/{RUN_ID}", null);
string content = await response.Content.ReadAsStringAsync();
Console.WriteLine(response.StatusCode);
Console.WriteLine(content);{
"message": "Run successfully canceled."
}{
"description": "Bad Request. Possibly invalid team_id/run_id format."
}{
"description": "Unauthorized. The Bearer token or API key is invalid or missing."
}{
"description": "Payment Required. Subscription not active or no credits available."
}{
"description": "Forbidden. You do not have permission to cancel this run."
}{
"description": "Not Found. The run or team was not found."
}{
"description": "Internal Server Error. Something went wrong on the server."
}