v2

Swagger 2.02026-08-01331211921.0 KB
Pullrequests

Merge a pull request

Merges the pull request.

post/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge

Query parameters

asyncboolean

Default value is false.

When set to true, runs merge asynchronously and immediately returns a 202 with polling link to the task-status API in the Location header.

When set to false, runs merge and waits for it to complete, returning 200 when it succeeds. If the duration of the merge exceeds a timeout threshold, the API returns a 202 with polling link to the task-status API in the Location header.

Request body

typestring required
messagestring

The commit message that will be used on the resulting commit. Note that the size of the message is limited to 128 KiB.

close_source_branchboolean

Whether the source branch should be deleted. If this is not provided, we fallback to the value used when the pull request was created, which defaults to False

merge_strategy'merge_commit' | 'squash' | 'fast_forward' | 'squash_fast_forward' | 'rebase_fast_forward' | 'rebase_merge'

The merge strategy that will be used to merge the pull request.

Response

The pull request object.

typestring required
idinteger

The pull request's unique ID. Note that pull request IDs are only unique within their associated repository.

titlestring

Title of the pull request.

state'OPEN' | 'MERGED' | 'DECLINED' | 'SUPERSEDED'

The pull request's current status.

comment_countinteger

The number of comments for a specific pull request.

task_countinteger

The number of open tasks for a specific pull request.

close_source_branchboolean

A boolean flag indicating if merging the pull request closes the source branch.

reasonstring

Explains why a pull request was declined. This field is only applicable to pull requests in rejected state.

created_onstring date-time

The ISO8601 timestamp the request was created.

updated_onstring date-time

The ISO8601 timestamp the request was last updated.

draftboolean

A boolean flag indicating whether the pull request is a draft.

queuedboolean

A boolean flag indicating whether the pull request is queued