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>",
"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": {}
}
]
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"answered_by": "customer"
}
}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>",
"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": {}
}
]
}
}{
"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.
Query Parameters
The last cursor you have. 0 for everything.
Wait up to this long for new events.
Required range:
x <= 55000