POST
/
v1
/
agent-tasks
/
{task_id}
/
cancel
Cancel a task
curl --request POST \
  --url https://platform.jobbit.uk/v1/agent-tasks/{task_id}/cancel \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://platform.jobbit.uk/v1/agent-tasks/{task_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://platform.jobbit.uk/v1/agent-tasks/{task_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://platform.jobbit.uk/v1/agent-tasks/{task_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://platform.jobbit.uk/v1/agent-tasks/{task_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://platform.jobbit.uk/v1/agent-tasks/{task_id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://platform.jobbit.uk/v1/agent-tasks/{task_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
{
  "task_id": "c41d7e0a-5b92-4f63-8e1a-3a9d2f6b7c10",
  "status": "cancelled",
  "reason": "cancelled",
  "goal_completed": null,
  "output": null,
  "text": null,
  "artifacts": [],
  "files": [],
  "error": null,
  "metrics": {
    "cost_credits": 41.25,
    "cost_usd": 0.12375,
    "turns": 7,
    "duration_seconds": 96.4
  },
  "chat_id": "9a2f6d1e-83c4-4b05-a7e9-0c5d1b4f2e68",
  "workspace": "kent-physio-site",
  "model": "jobbit/pro",
  "effort": "high",
  "on_question": "fail",
  "question": null,
  "questions_asked": 0,
  "budget_credits": 200,
  "source": {
    "ticket": "KP-142"
  },
  "created_at": "2026-11-05T14:02:11+00:00",
  "started_at": "2026-11-05T14:02:13+00:00",
  "finished_at": "2026-11-05T14:03:49+00:00"
}
{
"error": {
"code": "invalid_key",
"message": "the API key is missing or invalid",
"request_id": "5d3f0b7c8a2e4e19b6c47a90d1e2f3a4"
}
}
{
"error": {
"code": "insufficient_scope",
"message": "this key does not have the deploy:write permission",
"details": {
"required": "deploy:write"
},
"request_id": "5d3f0b7c8a2e4e19b6c47a90d1e2f3a4"
}
}
{
"error": {
"code": "not_found",
"message": "not found",
"request_id": "5d3f0b7c8a2e4e19b6c47a90d1e2f3a4"
}
}
{
"error": {
"code": "invalid_request",
"message": "the request is not valid",
"details": [
{
"location": [
"body",
"name"
],
"message": "String should match pattern '^[a-z0-9][a-z0-9-]*$'",
"type": "string_pattern_mismatch"
}
],
"request_id": "5d3f0b7c8a2e4e19b6c47a90d1e2f3a4"
}
}
{
"error": {
"code": "rate_limited",
"message": "too many read requests, retry in 4 s",
"details": {
"group": "read",
"limit": 120,
"window_seconds": 60
},
"request_id": "5d3f0b7c8a2e4e19b6c47a90d1e2f3a4"
}
}

Authorizations

Authorization
string
header
required

An API key from Settings → API keys, sent as Authorization: Bearer jb_live_…

Path Parameters

task_id
string
required

The task id.

Required string length: 1 - 64
Pattern: ^[A-Za-z0-9-]+$

Response

The task.

task_id
string
required

The task id.

status
enum<string>
required

Where the task is.

Available options:
queued,
running,
waiting_input,
succeeded,
failed,
cancelled
reason
string | null

Why the task is in this state: completed, cancelled, question, invalid_output, budget_exceeded, timed_out, goal_unreachable, worker_stopped, insufficient_credits or run_failed.

goal_completed
boolean | null

Whether the agent reports that the goal was met.

output
any

The result following your output_schema. Only set when the task succeeded and a schema was given.

text
string | null

The agent's final answer as text.

artifacts
object[]

Files the agent made.

files
string[]

Ids of the files handed to the task.

error
string | null

What went wrong, for a failed task.

metrics
object
chat_id
string | null

The id of the chat in the Jobbit app where the work happens.

workspace
string | null

The workspace key, if one was given.

model
string

The model the task runs on.

effort
string

The effort level.

on_question
enum<string>

Whether the task may ask questions.

Available options:
fail,
ask
question
object | null

The open question, while the status is waiting_input.

questions_asked
integer

How many questions the task has asked.

budget_credits
number

The most credits the task may spend.

source
object

Your source labels.

created_at
string<date-time>

When the task was created.

started_at
string<date-time> | null

When it started running.

finished_at
string<date-time> | null

When it finished.