POST/v2/projects/{projectId}/branches/merge/preview

Preview a branch merge

Previews a merge from a source branch to a target branch without applying it. Supply sourceBranchId to select the source branch for the preview; the merge session is associated with the specified project.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

1 parameter · 1 body field
projectIdintegerrequired
The project identifier as a 64-bit integer.

Source branch details for the merge preview.

sourceBranchIdintegerrequired
Source branch id

5 status codes
200Returns a merge session object containing its `id` and `targetBranchName`; `mergedAt` indicates whether the merge has been applied.
idintegerrequired
Branch merge ID
mergedAtintegeroptional
Date of merge. If null, merge was not applied yet
targetBranchNamestringrequired
Target branch name
400Returned when the request is invalid.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
401Returned when authentication is missing or invalid.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
403Returned when you do not have permission to preview the merge.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional
404Returned when the project or branch cannot be found.
codestringrequired
Allowed:unauthenticatedapi_access_forbiddenapi_key_not_foundinvalid_api_keyinvalid_project_api_keyproject_api_key_expiredbad_credentialsmfa_enabledinvalid_otp_codemfa_not_enabledcan_not_revoke_own_permissionsdata_corrupted
paramsarray<object>optional

Error handling

A 400 is returned when the request is invalid. A 401 is returned when authentication is missing or invalid, a 403 when you lack permission, and a 404 when the project or branch cannot be found. The projectId path parameter must identify the project, and sourceBranchId is required.