PUT /repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}

Mutates the specified pull request.

This can be used to change the pull request's branches or description.

Only open pull requests can be mutated.

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"

Request body fields

Name Type Required Description
source Object No
source.commit Object No
source.commit.hash String No
source.branch Object No
source.branch.name String No
source.branch.default_merge_strategy String No

The default merge strategy, when this endpoint is the destination of the pull request.

source.branch.merge_strategies[] Array No

Available merge strategies, when this endpoint is the destination of the pull request.

reviewers[] Array No

The list of users that were added as reviewers on this pull request when it was created. For performance reasons, the API only includes this list on a pull request's self URL.

reviewers[].uuid String No
reviewers[].created_on String No
reviewers[].type String Yes
reviewers[].display_name String No
reviewers[].links Object No

Links related to an Account.

reviewers[].links.avatar Object No

A link to a resource related to this object.

reviewers[].links.avatar.href String No
reviewers[].links.avatar.name String No
draft Boolean No

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

destination Object No
destination.commit Object No
destination.commit.hash String No
destination.branch Object No
destination.branch.name String No
destination.branch.default_merge_strategy String No

The default merge strategy, when this endpoint is the destination of the pull request.

destination.branch.merge_strategies[] Array No

Available merge strategies, when this endpoint is the destination of the pull request.

created_on String No

The ISO8601 timestamp the request was created.

participants[] Array No
    The list of users that are collaborating on this pull request.
    Collaborators are user that:

    * are added to the pull request as a reviewer (part of the reviewers
      list)
    * are not explicit reviewers, but have commented on the pull request
    * are not explicit reviewers, but have approved the pull request

    Each user is wrapped in an object that indicates the user's role and
    whether they have approved the pull request. For performance reasons,
    the API only returns this list when an API requests a pull request by
    id.
participants[].participated_on String No

The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.

participants[].type String Yes
participants[].approved Boolean No
participants[].state String No

Possible values:

  • "approved"
  • null
  • "changes_requested"
participants[].role String No

Possible values:

  • "PARTICIPANT"
  • "REVIEWER"
rendered Object No

User provided pull request text, interpreted in a markup language and rendered in HTML

rendered.description Object No
rendered.description.markup String No

The type of markup language the raw content is to be interpreted in.

Possible values:

  • "creole"
  • "markdown"
  • "plaintext"
rendered.description.html String No

The user's content rendered as HTML.

rendered.description.raw String No

The text as it was typed by a user.

rendered.title Object No
rendered.title.markup String No

The type of markup language the raw content is to be interpreted in.

Possible values:

  • "creole"
  • "markdown"
  • "plaintext"
rendered.title.html String No

The user's content rendered as HTML.

rendered.title.raw String No

The text as it was typed by a user.

rendered.reason Object No
rendered.reason.markup String No

The type of markup language the raw content is to be interpreted in.

Possible values:

  • "creole"
  • "markdown"
  • "plaintext"
rendered.reason.html String No

The user's content rendered as HTML.

rendered.reason.raw String No

The text as it was typed by a user.

comment_count Integer No

The number of comments for a specific pull request.

state String No

The pull request's current status.

Possible values:

  • "OPEN"
  • "DECLINED"
  • "SUPERSEDED"
  • "MERGED"
links Object No
links.html Object No

A link to a resource related to this object.

links.html.href String No
links.html.name String No
links.merge Object No

A link to a resource related to this object.

links.merge.href String No
links.merge.name String No
links.self Object No

A link to a resource related to this object.

links.self.href String No
links.self.name String No
links.diff Object No

A link to a resource related to this object.

links.diff.href String No
links.diff.name String No
links.decline Object No

A link to a resource related to this object.

links.decline.href String No
links.decline.name String No
links.commits Object No

A link to a resource related to this object.

links.commits.href String No
links.commits.name String No
links.approve Object No

A link to a resource related to this object.

links.approve.href String No
links.approve.name String No
links.diffstat Object No

A link to a resource related to this object.

links.diffstat.href String No
links.diffstat.name String No
links.comments Object No

A link to a resource related to this object.

links.comments.href String No
links.comments.name String No
links.activity Object No

A link to a resource related to this object.

links.activity.href String No
links.activity.name String No
id Integer No

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

task_count Integer No

The number of open tasks for a specific pull request.

close_source_branch Boolean No

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

merge_commit Object No
merge_commit.hash String No
type String Yes
title String No

Title of the pull request.

updated_on String No

The ISO8601 timestamp the request was last updated.

reason String No

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

summary Object No
summary.markup String No

The type of markup language the raw content is to be interpreted in.

Possible values:

  • "creole"
  • "markdown"
  • "plaintext"
summary.html String No

The user's content rendered as HTML.

summary.raw String No

The text as it was typed by a user.

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.