Merge the exact successful Publication head
const url = 'https://example.com/v1/sessions/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/publications/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/merges/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"strategy":"squash","mode":"when_ready","commitTitle":"Rate limit the payments endpoint (#482)","commitMessage":"Adds a sliding-window limiter of 100 requests per minute per API key."}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/v1/sessions/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/publications/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731/merges/9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "strategy": "squash", "mode": "when_ready", "commitTitle": "Rate limit the payments endpoint (#482)", "commitMessage": "Adds a sliding-window limiter of 100 requests per minute per API key." }'Branch protection stays authoritative. mode=when_ready leaves a durable waiting command; mode=now fails definitively when the provider is not mergeable.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731A UUID you mint and own; it is the idempotency key for creation and the address of every Turn, artifact and publication underneath
A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731A UUID you mint for this publish attempt; it is the idempotency and recovery key for the pull request
A UUID identifying one Cloud resource; Session, Turn, Publication and Merge ids are minted by the caller so an ambiguous retry addresses the same durable command instead of creating a second one.
Example
9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731A UUID you mint for this merge command; it is the idempotency and recovery key
Request Bodyrequired
Section titled “Request Bodyrequired”Body of the idempotent merge command. Every field has a default, so an empty object requests a squash merge attempted immediately.
object
Provider merge strategy — squash by default, or merge or rebase when the repository allows it
now fails definitively when the provider reports the pull request is not mergeable; when_ready parks a durable command that waits for checks and branch protection
Overrides the merge commit title the provider would otherwise generate
Overrides the merge commit body the provider would otherwise generate
Example
{ "strategy": "squash", "mode": "when_ready", "commitTitle": "Rate limit the payments endpoint (#482)", "commitMessage": "Adds a sliding-window limiter of 100 requests per minute per API key."}Responses
Section titled “Responses”Idempotent replay
Envelope returned when a Merge is created or read.
object
The Merge as it stands after this request; a 201 means it was newly admitted and a 200 means an identical retry returned the stored command
object
The caller-owned Merge id, a separate recovery unit from the Publication it integrates
Session the merged work belongs to
Publication whose successful head this command merges
admitted on acceptance, attempted while the provider merge is in flight, waiting for a when_ready command parked until the pull request becomes mergeable, then terminal succeeded or failed
Merge strategy actually recorded for this command
Whether this command was admitted as an immediate merge or a durable wait
Pull request being merged, taken from the Publication result rather than from the caller
The exact head this merge is pinned to; if the pull-request head moves the command fails instead of integrating unreviewed commits
Commit the provider created on the base branch; present once status is succeeded
Coarse machine code for the failure; present when status is failed
object
How many times a worker has attempted the provider merge, including waits that were re-checked
When the Merge was admitted
Last durable state change of the command
When the Merge reached succeeded or failed
Example
{ "merge": { "id": "5a3c9f71-2b84-4e6d-8c07-9f1b3d52e480", "sessionId": "9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731", "publicationId": "1e8d4b62-7f05-4c3a-9d21-6a48f0b7c952", "status": "succeeded", "strategy": "squash", "mode": "when_ready", "pullRequestNumber": 482, "expectedHeadSha": "281c35bbe1f0ed047127957c11858d1394722abf", "mergedCommitSha": "fb7f597cd47357afe2902c78ebd02c2b914b0e91", "attempts": 3, "createdAt": "2026-08-12T10:03:12Z", "updatedAt": "2026-08-12T10:12:47Z", "completedAt": "2026-08-12T10:12:47Z" }}Merge admitted
Envelope returned when a Merge is created or read.
object
The Merge as it stands after this request; a 201 means it was newly admitted and a 200 means an identical retry returned the stored command
object
The caller-owned Merge id, a separate recovery unit from the Publication it integrates
Session the merged work belongs to
Publication whose successful head this command merges
admitted on acceptance, attempted while the provider merge is in flight, waiting for a when_ready command parked until the pull request becomes mergeable, then terminal succeeded or failed
Merge strategy actually recorded for this command
Whether this command was admitted as an immediate merge or a durable wait
Pull request being merged, taken from the Publication result rather than from the caller
The exact head this merge is pinned to; if the pull-request head moves the command fails instead of integrating unreviewed commits
Commit the provider created on the base branch; present once status is succeeded
Coarse machine code for the failure; present when status is failed
object
How many times a worker has attempted the provider merge, including waits that were re-checked
When the Merge was admitted
Last durable state change of the command
When the Merge reached succeeded or failed
Example
{ "merge": { "id": "5a3c9f71-2b84-4e6d-8c07-9f1b3d52e480", "sessionId": "9f2b7c14-59d3-4f7a-b8e1-2a6c05d4e731", "publicationId": "1e8d4b62-7f05-4c3a-9d21-6a48f0b7c952", "status": "waiting", "strategy": "squash", "mode": "when_ready", "pullRequestNumber": 482, "expectedHeadSha": "281c35bbe1f0ed047127957c11858d1394722abf", "lastError": { "code": "merge_not_ready" }, "attempts": 1, "createdAt": "2026-08-12T10:03:12Z", "updatedAt": "2026-08-12T10:03:14Z" }}Headers
Section titled “Headers”The resource is missing or inaccessible
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_session_not_found"}Idempotency, lifecycle, revision or single-flight conflict
Failure body returned with every non-2xx JSON response; branch on the machine code, never on prose or on the HTTP status alone.
object
Stable machine code
The installation capability the presented credential lacks, returned with insufficient_scope so an integrator knows exactly which capability to request
Advisory seconds to wait before retrying; returned on rate-limit denials, where the Retry-After header carries the same value
Example
{ "error": "cloud_session_conflict"}