TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Meza-dev/Ghostly/llms.txt
Use this file to discover all available pages before exploring further.
POST /v1/run endpoint accepts a structured browser automation plan and launches it as a background job. The server responds with HTTP 202 and a { ok, id, status } envelope as soon as the run is registered — execution continues asynchronously. Use GET /v1/runs/:id to poll the final result or GET /v1/runs/:id/events/stream for live Server-Sent Events.
Authentication
Pass either an API key via theX-Api-Key header or a JWT via the Authorization: Bearer <token> header. Every request also requires Content-Type: application/json.
Request Body
Slug of an existing project that belongs to your account. The run is
associated with this project for filtering and grouping.
The root URL of the application under test (e.g.
https://app.example.com).
All goto step URLs must share the same origin as baseUrl.Ordered list of browser actions to execute. At least one step is required for
non-assisted runs. Maximum 25 steps by default.
Run the Chromium browser in headless mode. Set to
false only for local
debugging.Save a PNG screenshot after every step. Paths are returned in each
StepOutcome.screenshotPath.Capture the full accessibility tree after each step and attach it to the
corresponding
StepOutcome.a11y field.Record a WebM video of the session and persist it when the run ends in
fail status. The path is returned as RunRecord.videoPath.Local directory (relative to the runner process) where screenshots and videos
are written.
Per-step timeout in milliseconds. Must not exceed 120 000 ms. Individual
waitForSelector steps may override this via their own timeoutMs field.Arbitrary string that links this run to an external context, such as a Git
commit SHA or CI build ID.
Metadata produced by the Ghostly AI planner (v1). Present when the run was
generated by
POST /v1/plan.Enables AI-assisted v2 mode — the engine drives the browser autonomously
toward a goal using horizon-based planning and self-healing. Cannot be combined
with a manually authored
steps array as the primary plan.Static context about the application’s component library, forms, routes, and
selectors. Helps the AI planner produce more accurate selectors.
An alternative envelope for passing run configuration, used by the Ghostly MCP
submit_plan tool. Top-level fields take precedence over any matching keys
inside plan.Guardrails
The server enforces the following hard limits regardless of what you pass:| Guardrail | Default |
|---|---|
maxSteps | 25 |
maxTimeoutMs | 120 000 ms |
enforceSameOrigin | true — all goto URLs must share the origin of baseUrl |
Responses
Always
true on a successful 202 response.Unique identifier for the newly created run. Use it with
GET /v1/runs/:id,
POST /v1/runs/:id/cancel, and the SSE stream endpoint.Always
"running" in the 202 response — the run has been accepted and is
executing in the background.Error Responses
| Status | Body |
|---|---|
400 | { ok: false, error: "validación", details: object } — Zod validation failure |
400 | { ok: false, error: "project requerido" } — missing or blank project field |
400 | { ok: false, error: "project inválido" } — project not found for your account |
400 | { ok: false, error: "codeHints inválido", details: object } |
400 | { ok: false, error: "assisted inválido", details: object } |
400 | { ok: false, error: "assist inválido", details: object } — assist object failed validation |
409 | { ok: false, error: "assist v2 deshabilitado" } — v2 not enabled on this server |
500 | { ok: false, error: "no se pudo crear run", message: string } |
Examples
The run executes in the background — the 202 response is returned before
the browser flow completes. Use
GET /v1/runs/:id to poll the final result,
or subscribe to GET /v1/runs/:id/events/stream for real-time progress events.