/health:
they unlock its detailed operator response. Deployment automation can use an
optional INTERNAL_PROBE_TOKEN instead of a database-backed credential.
Liveness and readiness
Use liveness to decide whether to restart the web process:200 even when the
database contract is not ready.
200 only when the database is reachable and blocking data
migrations report ready; otherwise it returns 503. Worker heartbeat,
Temporal, and worker-schema parity do not decide web readiness because reads can
still be served while those asynchronous subsystems are unavailable.
Both the 200 and 503 responses contain aggregate status only:
Composite health
INTERNAL_PROBE_TOKEN on the application and send it as a
Bearer token. Never expose or log that value.
Detailed response:
/health remains the composite diagnostics endpoint. Its aggregate
status still degrades for a database or migration failure, a degraded or down
worker or Temporal service, or worker-schema drift. Use the explicit probe
endpoints for restart and traffic decisions.
The detailed body is an operator surface, not part of the public SDK response
schema. Anonymous clients and official SDK probe methods receive only
{ "status": ... }.
services.appRevision and services.workerRevision identify the public source
revision baked into each artifact. They are "unknown" when the build did not
provide APP_REVISION. Runtime environment overrides cannot change the reported
revision after the artifact is built.
scheduler_driver distinguishes a core deployment (none) from Temporal
scheduling (temporal) and legacy compatibility (legacy-auto). In core mode,
the detailed worker and temporal service states are disabled, not failed.
Invalid scheduler configuration reports invalid and degrades the probes. A
fresh worker heartbeat carrying a different driver reports
schedulerConfiguration: "driver-mismatch" and also degrades health.
A fresh worker heartbeat carrying a different known source revision reports
schedulerConfiguration: "release-mismatch" and also degrades health. Deploy web and worker
from the same immutable release before admitting traffic.
services.migrations answers whether blocking data migrations have finished
with their expected checksums and whether the public ID database contract is
ready. It does not report whether the Prisma schema is current. Run
npx prisma migrate status in the deployed application environment to check
schema currency. This known limitation is unchanged from 0.1.0 and is scheduled
to be addressed.
Composite status is 200 when all reported health checks succeed and 503 when
health is degraded.
OpenAPI
lib/api/openapi.ts.
Every operation documents the optional Bisibility-API-Version request header
and the 409 response returned for an unsupported declared version.
Capabilities
apiVersions is the set of API contracts this server serves.
scheduler_driver reports the execution backend available to API clients, and
rank_check_scheduler_mode reports automatic scheduling ownership. They belong here
because capabilities is the machine-readable contract discovery surface.
/health, /liveness, and /readiness remain operational probes and do not
duplicate API compatibility state.
Capabilities are derived from the OpenAPI operation ids and the agent-facing
tool input schemas in lib/api/capabilities.ts.
These camelCase names are REST/OpenAPI operation identifiers. MCP clients use
the separate unprefixed snake_case tool names advertised by /api/mcp, such as
list_keywords.
API version declaration
A client can opt into the advertised contract by sending:X- convention. A request with no
header, or an empty header, is undeclared and follows the existing request path
without version negotiation. This keeps clients deployed before version
declarations were introduced working unchanged.
If a client declares a version that is not in apiVersions, the server returns
409 Conflict before authentication, rate limiting, or request parsing:
Provider rates
Cost estimate
locations for
API compatibility), device count, schedule, provider, and organic result depth.
Pass depth=10, 20, 50, or 100; omitted depth defaults to 100.
checks_per_run counts logical rank checks. result_pages_per_run includes depth,
and monthly_billing_units estimates result pages for the full month. One keyword
in one market on one device, checked daily at Top 20, returns 1 check, 2 pages per
run, and 60 pages per month.
frequency accepts daily, weekly, monthly, manual, paused, or
custom_cron. Manual and paused schedules return zero scheduled runs and monthly
usage. For custom schedules, send cron_expression; a missing or invalid cron
returns null for runs_per_month and monthly usage/cost fields. Per-run usage
remains available. Estimates assume full depth; actual usage can be lower.