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

Merges the pull request.

Servers

Path parameters

Name Type Required Description
pull_request_id Integer Yes

The id of the pull request.

repo_slug String Yes

This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: {repository UUID}.

workspace String Yes

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Query parameters

Name Type Required Description
async Boolean No

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 fields

Name Type Required Description
close_source_branch Boolean No

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 String No

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

Possible values:

  • "rebase_fast_forward"
  • "squash"
  • "squash_fast_forward"
  • "merge_commit"
  • "fast_forward"
  • "rebase_merge"

Default value: "merge_commit"

message String No

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

type String Yes

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.