Quick choice
- Choose
revisewhen the website is still the right target and you need to change the build instructions, such as missing fields, extra fields, the wrong focus, or a tighter schema. - Choose
rebuildwhen the website changed, runtime health recommends it, or endpoint calls now fail broadly. - Choose
respondwhen the API is paused inneeds_input.
What each operation does
GET /v1/apis/{api_id}- Returns the current API record.
- Use it to inspect
status,endpoints, endpointruntime_policyandruntime_verification,failure,failure_reason_code, anduser_input_prompt.
GET /v1/apis/{api_id}/health- Returns binding-level runtime health when an API is published, or build-stage health when it has not published a binding yet.
- Use it to inspect
status,task_status,detail,recommended_action,failure, counters, timestamps, and per-endpoint health.
POST /v1/apis/{api_id}/respond- Sends a response only when the API status is
needs_input. - Optional body flags:
wait_for_completion,timeout_ms.
- Sends a response only when the API status is
POST /v1/apis/{api_id}/revise- Queues a revision with new
instructions. - Use it when the target is still right but the build intent needs to change.
- Queues a revision with new
POST /v1/apis/{api_id}/rebuild- Queues a fresh rebuild from the same binding.
- Use it when the underlying site or request surface likely changed.
id is the durable identity. Endpoint names and schemas can change after a successful revise or rebuild, so re-inspect the API before calling an updated endpoint.
Decision rules
| Symptom | Right move | Reason |
|---|---|---|
status: "needs_input" with a user_input_prompt | respond | The build is paused and waiting for input. |
API is completed but the shape is wrong | revise | The target is right, but the build intent is wrong. |
Published API health returns recommended_action: "rebuild" | rebuild | Runtime indicates the published binding is stale or unhealthy. |
Build-stage health returns status: "build_failed" | Follow failure.recommended_action | No binding was published yet, so inspect the structured failure before choosing revise, retry, or support. |
| Endpoint calls started failing broadly on a previously healthy API | health, then likely rebuild | Check health before assuming site change. |
| Instructions are clearly wrong but the site still works | revise | Do not rebuild on the same instructions. |
Status handling
| Status | What it means | Next action |
|---|---|---|
queued / running | Build is in progress. | Wait. Do not revise or rebuild yet. |
needs_input | Build paused; user_input_prompt describes what it needs. | respond with the requested payload. A respond call outside this state returns 409. |
completed | Contract is published and callable. | Safe point for revise, health, and endpoint calls. |
failed | Build did not complete. Check failure_reason_code, failure.non_publishable_reason, and failure.artifact. | Follow failure.artifact.suggested_user_action. Build failure classes and examples are documented in Errors. |
error_code catalog in Errors helps you decide between retry, rebuild, and revise.
Health semantics
GET /v1/apis/{api_id}/health returns one of three health shapes.
For a published API, it returns binding-level runtime health:
status: "build_failed", task_status: "failed", failure_reason_code, a detail string with the build failure context, a top-level recommended_action copied from the structured failure, and the same structured failure object exposed by GET /v1/apis/{api_id}.
| Health signal | What it means | Next action |
|---|---|---|
status: "pending_build" | The API exists, but no binding is published yet. | Wait, or inspect GET /v1/apis/{api_id} if task_status is needs_input. |
status: "build_failed" | The build failed before publishing a callable binding. | Inspect failure on the health or API detail response and follow failure.artifact.suggested_user_action. |
status: "healthy", recommended_action: "none" | Recent calls are succeeding. | No action needed. |
status: "degraded" | Mixed success and failure in the window. | Check which endpoints are failing in endpoints[] before choosing rebuild or revise. |
status: "needs_rebuild" or recommended_action: "rebuild" | Failure rate or quality score crossed the rebuild threshold. | Prefer rebuild over revise unless your instructions are clearly wrong. |
Re-validate after any update
Call the same endpoint name again afterrespond, revise, or rebuild.
api.statusapi.failure- endpoint list
- one or two critical runtime calls