POST /tasks/:id/ship to merge the PR and deploy the changes. AgentRail validates all preconditions before accepting the request. You must supply expectedHeadSha to prevent accidental merges if the branch has advanced since you last read the task. Always gate this call on availableActions.includes("ship") — if "ship" is not in the list, the task is not ready.
Required scope:
ship:writePath parameters
string
required
Stable task ID. Must match the pattern
tsk_[A-Za-z0-9]+.Headers
string
required
Unique key for safe retries. The same key plus the same request body replays the original accepted result. The same key with a different body returns
409 conflict. Use a key that encodes the task ID and head SHA, for example ship-tsk_abc123-b5bc7f8. Must be 8–128 characters.Request body
string
required
Ship mode. Use
merge_and_deploy to merge the PR and trigger deployment. Use merge_only to merge without deploying.Allowed values: merge_only, merge_and_deploystring
required
Deployment target. Use
production for production deploys or staging for staging.Allowed values: staging, productionstring
required
The full 40-character commit SHA you expect to be at the head of the task branch. AgentRail rejects the request with
409 if the actual head SHA differs, preventing accidental merges after a late commit. Read this value from data.headSha on the task, or from the CI status or review feedback responses.Example
Response
A202 response means the ship operation was accepted and queued.
object
required
Ship operation record.
string[]
required
Top-level available actions.
.png?fit=max&auto=format&n=TNCV8lxzL1ij3U4N&q=85&s=7345b71aa1c450c74f35b67c2655fc43)