Stop a task
curl --request POST \
--url https://guidinghand.ai/v1/tasks/{task_id}/stop \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/tasks/{task_id}/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/tasks/{task_id}/stop"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"object": "task",
"task_id": "<string>",
"kind": "computer",
"procedure": {
"id": "<string>",
"revision": 123,
"ran_on": "steps"
},
"session_id": "<string>",
"agent_id": "<string>",
"status": "queued",
"done": true,
"prompt": "<string>",
"result": "<string>",
"error": "<string>",
"conversation_id": "<string>",
"paused_for": {
"kind": "approval",
"id": "<string>",
"conversation_id": "<string>"
},
"pending": {
"type": "question",
"question_id": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"customer_can_answer": true,
"conversation_id": "<string>"
},
"cursor": 123,
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"active_seconds": 123,
"model": "gpt-6-astra",
"effort": "low",
"usage": {
"input_tokens": 123,
"cached_tokens": 123,
"cache_write_tokens": 123,
"output_tokens": 123,
"reasoning_tokens": 123
},
"cost_cents": 123,
"agent_version": 3,
"agent_draft": true,
"created_by": {
"type": "user",
"email": "jane@acme.com"
},
"replay_url": "<string>",
"recording": {
"frames": 123
},
"events": [
{
"cursor": 123,
"type": "started",
"message": "<string>",
"ts": "2023-11-07T05:31:56Z",
"data": {}
}
],
"procedures": [
{
"id": "<string>",
"revision": 123,
"title": "<string>",
"confidence": 123
}
],
"interrupted": true
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Tasks
Stop a task
POST
/
v1
/
tasks
/
{task_id}
/
stop
Stop a task
curl --request POST \
--url https://guidinghand.ai/v1/tasks/{task_id}/stop \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/tasks/{task_id}/stop', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/tasks/{task_id}/stop"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"object": "task",
"task_id": "<string>",
"kind": "computer",
"procedure": {
"id": "<string>",
"revision": 123,
"ran_on": "steps"
},
"session_id": "<string>",
"agent_id": "<string>",
"status": "queued",
"done": true,
"prompt": "<string>",
"result": "<string>",
"error": "<string>",
"conversation_id": "<string>",
"paused_for": {
"kind": "approval",
"id": "<string>",
"conversation_id": "<string>"
},
"pending": {
"type": "question",
"question_id": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"customer_can_answer": true,
"conversation_id": "<string>"
},
"cursor": 123,
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"active_seconds": 123,
"model": "gpt-6-astra",
"effort": "low",
"usage": {
"input_tokens": 123,
"cached_tokens": 123,
"cache_write_tokens": 123,
"output_tokens": 123,
"reasoning_tokens": 123
},
"cost_cents": 123,
"agent_version": 3,
"agent_draft": true,
"created_by": {
"type": "user",
"email": "jane@acme.com"
},
"replay_url": "<string>",
"recording": {
"frames": 123
},
"events": [
{
"cursor": 123,
"type": "started",
"message": "<string>",
"ts": "2023-11-07T05:31:56Z",
"data": {}
}
],
"procedures": [
{
"id": "<string>",
"revision": 123,
"title": "<string>",
"confidence": 123
}
],
"interrupted": true
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Authorizations
Response
OK
computer for a task on a computer or a cloud browser; chat for a run of a chat procedure in a conversation (its steps without AI, the model following it, or both). A chat run's events are what it did, and cost_cents is what its replies came to; it is never charged on its own, its replies are.
Available options:
computer, chat The conversation where its questions and approvals are asked and decided: the chat’s, for a task an agent started from a conversation, or one of its own (with its agent, holding the task) for a task started directly. Decide in it with POST /v1/conversations/{conversation_id}/decisions. Null for tasks from before every task had one.