Follow a task
curl --request GET \
--url https://guidinghand.ai/v1/tasks/{task_id}/events \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/tasks/{task_id}/events', 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}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"cursor": 123,
"type": "started",
"message": "<string>",
"ts": "2023-11-07T05:31:56Z",
"data": {}
}
],
"cursor": 123,
"task": {
"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
}
]
}
}{
"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
Follow a task
Events after after. With wait_ms, waits for the next event (long poll). Call again with the returned cursor until task.done is true, answering task.pending when it is set.
GET
/
v1
/
tasks
/
{task_id}
/
events
Follow a task
curl --request GET \
--url https://guidinghand.ai/v1/tasks/{task_id}/events \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/tasks/{task_id}/events', 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}/events"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"data": [
{
"cursor": 123,
"type": "started",
"message": "<string>",
"ts": "2023-11-07T05:31:56Z",
"data": {}
}
],
"cursor": 123,
"task": {
"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
}
]
}
}{
"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>"
}
}