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>",
"session_id": "<string>",
"agent_id": "<string>",
"status": "queued",
"done": true,
"prompt": "<string>",
"result": "<string>",
"error": "<string>",
"pending": {
"type": "question",
"question_id": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"customer_can_answer": true
},
"cursor": 123,
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"active_seconds": 123,
"billed_minutes": 123,
"replay_url": "<string>",
"recording": {
"frames": 123
},
"events": [
{
"cursor": 123,
"type": "started",
"message": "<string>",
"ts": "2023-11-07T05:31:56Z",
"data": {}
}
],
"interrupted": true
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}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>",
"session_id": "<string>",
"agent_id": "<string>",
"status": "queued",
"done": true,
"prompt": "<string>",
"result": "<string>",
"error": "<string>",
"pending": {
"type": "question",
"question_id": "<string>",
"question": "<string>",
"options": [
"<string>"
],
"customer_can_answer": true
},
"cursor": 123,
"metadata": {
"customer_id": "cus_42"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"active_seconds": 123,
"billed_minutes": 123,
"replay_url": "<string>",
"recording": {
"frames": 123
},
"events": [
{
"cursor": 123,
"type": "started",
"message": "<string>",
"ts": "2023-11-07T05:31:56Z",
"data": {}
}
],
"interrupted": true
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Path Parameters
The task’s id.
Response
OK
Available options:
queued, running, waiting_for_user, waiting_for_approval, completed, failed, stopped The agent’s summary when it finished.
What the agent waits on: answer it with /respond.
- Question
- Approval
Show child attributes
Show child attributes
The latest event’s cursor.
Your own ids and labels (e.g. a ticket or customer id), returned as given.
Show child attributes
Show child attributes
Example:
{ "customer_id": "cus_42" }
Time spent running (not waiting on a person).
The replay in the console.
Show child attributes
Show child attributes
With include=events.
Show child attributes
Show child attributes
False when the task had already finished.