Schedules
Draft a schedule probe
Draft a completion probe from the schedule’s runs marked as passing or failing.
POST
/
api
/
v2
/
schedules
/
{schedule_id}
/
probe
/
draft
from hai_agents import Client
client = Client()
draft = client.schedules.draft_schedule_probe(schedule_id)
print(draft.probe or draft.reason)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const draft = await client.schedules.draftScheduleProbe({ scheduleId });
console.log(draft.probe ?? draft.reason);
curl -X POST "https://agp.eu.hcompany.ai/api/v2/schedules/$SCHEDULE_ID/probe/draft" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"probe": null,
"reason": "3 passing runs with a browser end state are needed, 1 found (4 labelled runs recorded none: is capture_end_state on?).",
"passing_runs": 1,
"failing_runs": 2,
"reference_runs": 0,
"unrecorded_runs": 4
}
Behavior
Drafts a completion probe from the browser end states of the schedule’s finished runs that a person marked as passing or failing, for example with session feedback. It reads up to 10 of the newest of each. The probe must pass every passing run, and fail every failing run and the passing runs of the other schedules you can see. Nothing is stored. Completion probes are not available to every organization yet. A draft needs at least 3 passing runs with a browser end state. When none can be drafted,probe is null and reason says why.
Path parameters
Response
200 with the draft.
The drafted probe, to review before you set it as the schedule’s
probe. null when none could be drafted.Passing runs of the other schedules you can see that the draft used. The probe must fail them.
Marked runs left out because their browser recorded no end state. Many of them next to few runs used means
capture_end_state was off when they ran.from hai_agents import Client
client = Client()
draft = client.schedules.draft_schedule_probe(schedule_id)
print(draft.probe or draft.reason)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const draft = await client.schedules.draftScheduleProbe({ scheduleId });
console.log(draft.probe ?? draft.reason);
curl -X POST "https://agp.eu.hcompany.ai/api/v2/schedules/$SCHEDULE_ID/probe/draft" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"probe": null,
"reason": "3 passing runs with a browser end state are needed, 1 found (4 labelled runs recorded none: is capture_end_state on?).",
"passing_runs": 1,
"failing_runs": 2,
"reference_runs": 0,
"unrecorded_runs": 4
}
Errors
| Status | Cause |
|---|---|
404 | Not found, not in your organization, or you do not see its creator’s sessions. |
409 | A draft for this schedule is already in progress. |
502 | A run’s end state could not be read. Retry later. |
504 | The draft took over 120 seconds. |
Was this page helpful?
⌘I
from hai_agents import Client
client = Client()
draft = client.schedules.draft_schedule_probe(schedule_id)
print(draft.probe or draft.reason)
import { HaiAgentsClient } from "hai-agents";
const client = new HaiAgentsClient();
const draft = await client.schedules.draftScheduleProbe({ scheduleId });
console.log(draft.probe ?? draft.reason);
curl -X POST "https://agp.eu.hcompany.ai/api/v2/schedules/$SCHEDULE_ID/probe/draft" \
-H "Authorization: Bearer $HAI_API_KEY"
{
"probe": null,
"reason": "3 passing runs with a browser end state are needed, 1 found (4 labelled runs recorded none: is capture_end_state on?).",
"passing_runs": 1,
"failing_runs": 2,
"reference_runs": 0,
"unrecorded_runs": 4
}