Run a schedule now
curl --request POST \
--url https://guidinghand.ai/v1/agents/{agent_id}/schedules/{schedule_id}/run \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/schedules/{schedule_id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/agents/{agent_id}/schedules/{schedule_id}/run"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"object": "schedule_run",
"id": "srun_3f9a0c1b2d4e5f6a7b",
"schedule_id": "<string>",
"trigger": "schedule",
"status": "running",
"due_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"conversation_id": "<string>",
"result": "<string>",
"error": "<string>",
"escalations": 123,
"cost_cents": 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>"
}
}Schedules
Run a schedule now
Whatever its status or time. Returns the run as it starts; poll it, or wait for the webhook.
POST
/
v1
/
agents
/
{agent_id}
/
schedules
/
{schedule_id}
/
run
Run a schedule now
curl --request POST \
--url https://guidinghand.ai/v1/agents/{agent_id}/schedules/{schedule_id}/run \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/schedules/{schedule_id}/run', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/agents/{agent_id}/schedules/{schedule_id}/run"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"object": "schedule_run",
"id": "srun_3f9a0c1b2d4e5f6a7b",
"schedule_id": "<string>",
"trigger": "schedule",
"status": "running",
"due_at": "2023-11-07T05:31:56Z",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"conversation_id": "<string>",
"result": "<string>",
"error": "<string>",
"escalations": 123,
"cost_cents": 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>"
}
}Authorizations
An org API key (gh_live_…) from Settings → API keys in the console.
Response
The run.
One run of a schedule, or a slot it skipped or missed.
Example:
"srun_3f9a0c1b2d4e5f6a7b"
schedule: on time; manual: run now.
Available options:
schedule, manual waiting: on the team’s decision (an approval or a question in its conversation). skipped: its last run was still going, or the org had its most runs going at once. missed: no server was up when it was due, and it was over an hour late.
Available options:
running, waiting, completed, failed, stopped, skipped, missed The run’s conversation: everything it said and did.
What the agent said last.
Escalations it raised.
What its replies and tasks came to, at list price.