Skip to main content

Merge requests

Generated from apiome-rest/openapi.yaml (API version 1.719.0) — do not edit by hand. How to authenticate is on the REST API reference.

Tag: merge-requests · 9 operations

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/draft-branches​

List draft branches

List the project's draft branches, each with the version line it was drafted off.

One page of at most limit branches (1,000 at most), newest first; pass next_cursor as cursor until has_more is false (#7196).

Operation id: list_draft_branches_v1_tenants__tenant_slug__projects__project_ref__draft_branches_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
limitqueryintegernoPage size. At most 1000.
cursorquerystring or nullnoOpaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for list draft branches.application/json DraftBranchListResponse
404Unknown project, branch, or merge request (mr-*-not-found).—
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/draft-branches​

Create a draft branch off a version line

Create a named draft branch off a version line (a branch; the default branch when omitted).

The line's tip is copied — classes and paths — into a new draft revision that becomes the branch's tip, so edits on the branch never touch the line. version_label names that revision; it defaults to the next patch version of the project.

Operation id: create_draft_branch_v1_tenants__tenant_slug__projects__project_ref__draft_branches_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for create a draft branch off a version line.

Responses

StatusDescriptionBody
201Successful response for create a draft branch off a version line.application/json DraftBranchRecord
403Missing permission, or the action needs an attributable user.—
404Unknown project, branch, or merge request (mr-*-not-found).—
409The request conflicts with the current state (see the code).—
422Validation Errorapplication/json HTTPValidationError

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests​

List merge requests

A page of the project's merge requests, most recently active first.

Pages by cursor: pass the previous page's next_cursor until has_more is false. The total is counted only when include_total is set.

Operation id: list_merge_requests_v1_tenants__tenant_slug__projects__project_ref__merge_requests_get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
statequeryenum "open", "merged", "closed" or nullnoOnly requests in this state.
limitqueryintegernoPage size. At most 100.
cursorquerystring or nullnoOpaque cursor from the previous page (next_cursor, or the X-Next-Cursor header). Omit for the first page.
include_totalquerybooleannoAlso count the matching rows. Off by default because counting reads every match; the count stops at 10,000.
offsetqueryintegernoRows to skip. Deprecated: page with cursor instead. At most 10,000.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for list merge requests.application/json MergeRequestListResponse
404Unknown project, branch, or merge request (mr-*-not-found).—
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests​

Open a merge request

Open a merge request from a draft branch into a line (the line it was drafted off by default).

The branch tip's review is requested from reviewers (COL-2.1), or the tip's open review is attached when it already has one.

Operation id: open_merge_request_v1_tenants__tenant_slug__projects__project_ref__merge_requests_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for open a merge request.

Responses

StatusDescriptionBody
201Successful response for open a merge request.application/json MergeRequestDetail
403Missing permission, or the action needs an attributable user.—
404Unknown project, branch, or merge request (mr-*-not-found).—
409The request conflicts with the current state (see the code).—
422Validation Errorapplication/json HTTPValidationError

GET /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests/{merge_request_id}​

Read a merge request

Read a merge request: its branches' tips, merge base, review, merge session, and readiness.

Operation id: read_merge_request_v1_tenants__tenant_slug__projects__project_ref__merge_requests__merge_request_id__get

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
merge_request_idpathstringyesPath parameter identifying the merge request id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for read a merge request.application/json MergeRequestDetail
404Unknown project, branch, or merge request (mr-*-not-found).—
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests/{merge_request_id}/check​

Check a merge request for conflicts

Run a merge session (the existing merge preview, persisted) for the current tips.

The session's conflicts come back on conflicts; a session with conflicts is left in resolving until the branch is updated and checked again.

Operation id: check_merge_request_v1_tenants__tenant_slug__projects__project_ref__merge_requests__merge_request_id__check_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
merge_request_idpathstringyesPath parameter identifying the merge request id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (optional)

Request body for check a merge request for conflicts.

Responses

StatusDescriptionBody
200Successful response for check a merge request for conflicts.application/json MergeRequestDetail
403Missing permission, or the action needs an attributable user.—
404Unknown project, branch, or merge request (mr-*-not-found).—
409The request conflicts with the current state (see the code).—
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests/{merge_request_id}/close​

Close a merge request without merging

Close the merge request. The branch and its revisions stay; its review is withdrawn when allowed.

Operation id: close_merge_request_v1_tenants__tenant_slug__projects__project_ref__merge_requests__merge_request_id__close_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
merge_request_idpathstringyesPath parameter identifying the merge request id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Responses

StatusDescriptionBody
200Successful response for close a merge request without merging.application/json MergeRequestDetail
403Missing permission, or the action needs an attributable user.—
404Unknown project, branch, or merge request (mr-*-not-found).—
409The request conflicts with the current state (see the code).—
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests/{merge_request_id}/merge​

Merge a merge request

Merge the branch into the line through a merge session and the existing merge path.

Needs the review approved and current (and the approval policy satisfied, when one applies). Conflicts refuse with mr-conflicts; the merge path's own refusals (STALE_HEAD, PUBLISHED_IMMUTABLE, MERGE_BLOCKED_BY_COMPAT_GATE) pass through unchanged.

Operation id: merge_merge_request_v1_tenants__tenant_slug__projects__project_ref__merge_requests__merge_request_id__merge_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
merge_request_idpathstringyesPath parameter identifying the merge request id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (optional)

Request body for merge a merge request.

Responses

StatusDescriptionBody
200Successful response for merge a merge request.application/json MergeRequestDetail
403Missing permission, or the action needs an attributable user.—
404Unknown project, branch, or merge request (mr-*-not-found).—
409The request conflicts with the current state (see the code).—
422Validation Errorapplication/json HTTPValidationError

POST /v1/tenants/{tenant_slug}/projects/{project_ref}/merge-requests/{merge_request_id}/review​

Request a review of the branch's current tip

Attach a review of the branch's current tip, withdrawing the review of an older tip.

Use it after the branch moved on (review-outdated) or its review was withdrawn. A review whose round went stale on the same tip is re-requested on the review page instead.

Operation id: request_merge_request_review_v1_tenants__tenant_slug__projects__project_ref__merge_requests__merge_request_id__review_post

Parameters

NameInTypeRequiredDescription
tenant_slugpathstringyesURL-safe tenant slug that scopes the request.
project_refpathstringyesPath parameter identifying the project ref segment.
merge_request_idpathstringyesPath parameter identifying the merge request id segment.
authorizationheaderstring or nullnoJWT bearer token for authenticated access (Authorization: Bearer <token>).
X-API-Keyheaderstring or nullnoTenant-scoped API key used as an alternative to JWT bearer authentication.

Request body (required)

Request body for request a review of the branch's current tip.

Responses

StatusDescriptionBody
200Successful response for request a review of the branch's current tip.application/json MergeRequestDetail
403Missing permission, or the action needs an attributable user.—
404Unknown project, branch, or merge request (mr-*-not-found).—
409The request conflicts with the current state (see the code).—
422Validation Errorapplication/json HTTPValidationError

Schemas used​

DraftBranchCreate​

Create a draft branch off a version line.

Attributes: name: The new branch's name (letters, digits, . _ - /; starts with a letter). base_branch: The version line to draft off — a branch name or id. Omit for the project's default branch. version_label: The draft revision's version label. Omit to take the next patch version.

PropertyTypeRequiredDescription
namestringyesHuman-readable name.
base_branchstring or nullnoBase Branch.
version_labelstring or nullnoVersion Label.

DraftBranchListResponse​

A project's draft branches.

PropertyTypeRequiredDescription
branchesarray of DraftBranchRecordnoNewest first.
has_morebooleannoWhether another page exists.
next_cursorstring or nullnoPass as cursor to read the next page; null on the last page.

DraftBranchRecord​

A draft branch, with the line it was drafted off.

PropertyTypeRequiredDescription
idstringyesThe branch id.
project_idstringyesProject identifier the resource belongs to.
namestringyesHuman-readable name.
tip_revision_idstringyesThe branch's tip — the draft revision edits land on.
tip_version_labelstring or nullnoThe tip's version label.
base_branch_idstring or nullnoThe version line (branch) it was drafted off; null once that branch is gone.
base_branch_namestring or nullnoThat line's name.
branched_from_revision_idstring or nullnoThe line's tip when the draft was created.
created_bystring or nullnoCreated By.
created_atstring (date-time) or nullnoCreation timestamp (ISO 8601).

HTTPValidationError​

Validation error response emitted when request data fails schema checks.

PropertyTypeRequiredDescription
detailarray of ValidationErrornoDetail.

MergeRequestCreate​

Open a merge request from a draft branch, asking reviewers to review its tip.

Attributes: source_branch: The draft branch — name or id. target_branch: The line to merge into — name or id. Omit for the line the draft was drafted off. title: A one-line summary. description: Optional detail. reviewers: User ids of the tenant members to ask; the requester cannot be one of them. Required unless the branch tip already has an open review, which is then attached.

PropertyTypeRequiredDescription
source_branchstringyesSource Branch.
target_branchstring or nullnoTarget Branch.
titlestringyesTitle.
descriptionstring or nullnoFree-text description.
reviewersarray of string or nullnoReviewers.

MergeRequestDetail​

A merge request with its branches, review, merge session, and readiness.

PropertyTypeRequiredDescription
merge_requestMergeRequestRecordyesMerge Request.
source_tip_revision_idstring or nullnoThe branch's current tip.
source_tip_version_labelstring or nullnoSource Tip Version Label.
target_tip_revision_idstring or nullnoThe line's current tip.
target_tip_version_labelstring or nullnoTarget Tip Version Label.
merge_base_revision_idstring or nullnoThe common ancestor the Changes tab compares the branch tip with.
merge_base_version_labelstring or nullnoMerge Base Version Label.
reviewReviewDetail or nullnoThe attached review, when there is one.
review_outdatedbooleannoTrue when the review judged an older tip than the branch's current one.
merge_sessionobject or nullnoThe latest merge session (status, tips, merge base).
conflictsarray of MergeConflictnoThat session's conflicts, when its tips are still current.
readinessMergeReadinessyesReadiness.

MergeRequestListResponse​

A page of a project's merge requests.

PropertyTypeRequiredDescription
merge_requestsarray of MergeRequestRecordnoMerge requests, most recently active first.
countintegeryesHow many merge requests this page holds.
totalinteger or nullnoHow many merge requests match the filter, counted up to 10,000. Present only when the request set include_total.
limitintegeryesLimit.
offsetintegeryesThe offset used (deprecated; 0 when paging by cursor).
has_morebooleannoWhether another page exists.
next_cursorstring or nullnoPass as cursor to read the next page; null on the last page.

MergeRequestMerge​

Merge an approved merge request.

Attributes: override_published_immutability: Tenant administrators only — merge into a line whose tip is published and immutable (forwarded to the merge path, which audits it). override_reason: The audit text for that override.

PropertyTypeRequiredDescription
override_published_immutabilitybooleannoOverride Published Immutability.
override_reasonstring or nullnoOverride Reason.

MergeRequestReviewRequest​

Request a review of the source branch's current tip.

Used when the branch moved on after the review was requested (review-outdated) or the review was withdrawn. Any open review of an older tip is withdrawn first.

Attributes: reviewers: The reviewers to ask; omit to ask the previous review's reviewers again.

PropertyTypeRequiredDescription
reviewersarray of string or nullnoReviewers.