Rehearse an apply plan on a contained branch
Upgrades the source plan to reviewed_plan mode, rejects stale fingerprints before allocating a branch, snapshots the source project, creates a contained data branch, applies the candidate, and returns a dated rehearsal certificate. Passing reports include an exact bound commit call with required_plan; commits re-derive current facts and fail closed on drift. CI sessions are rejected in v1. The plan's bytes must already be uploaded: an unmet missing_content is refused 409 REHEARSAL_CONTENT_MISSING (with details.missing_content and an upload_content next action) before any snapshot or branch is spent; a project with no live release rehearses on an empty branch. The rehearsal runs on the gateway, detached from the request: with Prefer: respond-async the call answers 202 at once with the operation (report: null, a poll next action, header Preference-Applied: respond-async) and the report appears as rehearsal_report on GET /apply/v1/operations/{operation_id} once the operation is ready or failed; without it the 202 carries the report. A rehearsal whose gateway task stops before it finishes ends failed with a retryable OPERATION_INTERRUPTED naming the branch it left (details.branch_project_id).
Request
- Base URL: https://api.run402.com
- URL: https://api.run402.com/apply/v1/plans/{plan_id}/rehearse
- Auth: one of:
- API key in header SIGN-IN-WITH-X
- HTTP bearer
- HTTP bearer
Path parameters
Apply plan id returned by POST /apply/v1/plans.
Headers
respond-async answers 202 as soon as the rehearsal's operation exists (RehearsePlanAccepted) instead of waiting for its report.
SIWX auth header — base64-encoded JSON payload containing a signed CAIP-122 (EIP-4361) message. See https://docs.x402.org/extensions/sign-in-with-x.
Request body
Response
With Prefer: respond-async: the rehearsal is running (RehearsePlanAccepted); poll the operation for its rehearsal_report. Without it: the rehearsal completed or failed with a report (RehearsePlanResponse). A failed report is still a successful HTTP response unless the orchestration itself failed.
Example response
{
"report": {
"source_project_id": "prj_1741340000_0042",
"next_actions": [
{
"method": "POST",
"path": "/tiers/v1/hobby",
"auth": "x402"
}
]
}
}Changes
No recorded changes to this operation across all 1 revision of this API.