Skip to main content
When your agent finishes coding, call POST /tasks/:id/submit to hand the work off to AgentRail. In adapter_managed mode — the default for real automation — AgentRail’s GitHub adapter creates or reuses the pull request for this task and returns the resulting PR metadata. Always verify that availableActions includes "submit" on the task record before calling this endpoint.
Required scope: tasks:write
Check availableActions.includes("submit") on the task before calling this endpoint. Submitting a task that is already in_review returns 409.

Path 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 attempt number, for example submit-tsk_abc123-v1. Must be 8–128 characters.

Request body

string
required
Human-readable description of the work done. Maximum 2000 characters.
string
default:"adapter_managed"
Submit mode. Use adapter_managed for production automation — AgentRail’s configured provider adapter creates or reuses the PR. Use artifact only for local demos without provider credentials.
object
Optional PR hints for adapter-managed submit.
object[]
Optional self-reported check results to attach to the submission.
string
Optional internal notes for the submission. Maximum 2000 characters.

Example

Response

A 202 response means the submission was accepted and routed to review.
object
required
Submission record.
string[]
required
Top-level available actions.

Example response

Error responses

Store the data.headSha from the submission response. You will need to pass it as expectedHeadSha when calling POST /tasks/:id/ship to prevent accidental merges if the branch advances.