> ## Documentation Index
> Fetch the complete documentation index at: https://hub.hcompany.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> H Platform has three products: the Agents API (managed computer-use agents, base URL https://agp.eu.hcompany.ai/api/v2 or https://agp.hcompany.ai/api/v2 for the US), the Models API (OpenAI-compatible Holo vision-language models at https://api.hcompany.ai/v1), and HoloTab (a free no-code Chrome extension that runs Holo in the user's browser, with recordable routines and schedules). The `holo` CLI (`pip install "hai-agents[cli]"`) runs Agents API agents from a terminal, drives the user's own desktop with `-a h/holo-desktop`, and serves coding agents through `holo mcp`.
> Authenticate with a bearer API key from the HAI_API_KEY environment variable. SDKs: `pip install hai-agents` (Python, `from hai_agents import Client`) and `npm install hai-agents` (TypeScript, `import { HaiAgentsClient } from "hai-agents"`). CLI: `holo`.
> Agents do work in a browser or on a desktop; describe the task as an imperative instruction. To run a task quickly, prefer the pre-built agent `h/web-surfer-flash`. Read results from the session's `latest_answer` after it reaches a terminal status.
> Sessions are the unit of work; wait for a terminal status (completed, failed, timed_out, interrupted) before reading the answer. Use webhooks or the `changes` long-poll endpoint to follow progress.

# Draft a schedule probe

> Draft a completion probe from the schedule's runs marked as passing or failing.

## Behavior

Drafts a [completion probe](https://hub.hcompany.ai/agents-api/schedules/retrieve.md#param-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](https://hub.hcompany.ai/agents-api/sessions/feedback.md). 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

**schedule\_id** `string` *required*

The schedule's ID (UUID).

## Response

`200` with the draft.

**probe** `object | null` *required*

The drafted probe, to review before you set it as the schedule's `probe`. `null` when none could be drafted.

**reason** `string | null` *required*

Why no probe could be drafted. `null` with a probe.

**passing\_runs** `integer` *required*

Runs marked as passing that the draft used.

**failing\_runs** `integer` *required*

Runs marked as failing that the draft used.

**reference\_runs** `integer` *required*

Passing runs of the other schedules you can see that the draft used. The probe must fail them.

**unrecorded\_runs** `integer` *required*

Marked runs left out because their browser recorded no end state. Many of them next to few runs used means [`capture_end_state`](https://hub.hcompany.ai/agents-api/schedules/retrieve#param-capture-end-state) was off when they ran.

```python Python theme={"system"}
from hai_agents import Client

client = Client()

draft = client.schedules.draft_schedule_probe(schedule_id)
print(draft.probe or draft.reason)
```

```typescript TypeScript theme={"system"}
import { HaiAgentsClient } from "hai-agents";

const client = new HaiAgentsClient();

const draft = await client.schedules.draftScheduleProbe({ scheduleId });
console.log(draft.probe ?? draft.reason);
```

```bash cURL theme={"system"}
curl -X POST "https://agp.eu.hcompany.ai/api/v2/schedules/$SCHEDULE_ID/probe/draft" \
  -H "Authorization: Bearer $HAI_API_KEY"
```

```json 200 theme={"system"}
{
  "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. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.