WEBINARSandboxes for AI agents, Oct 7th.Sandboxes: give your AI agents a real machine. Live on October 7th.Register free

Update branch

View as Markdown
  • PUT
  • /workspaces
  • /:workspace
  • /projects
  • /:project_name
  • /repository
  • /pulls
  • /:number
  • /update-branch

Updates the head branch of a single pull request with changes from its base branch

Request

REQUIRED SCOPES
REPOSITORY_WRITE
URL PARAMETERS
workspacerequiredstring
The human-readable ID of the workspace

Example: "my-company"

project_namerequiredstring
The human-readable ID of the project

Example: "my-project"

numberrequiredinteger
The pull request number

Example: 5

Response

RESPONSE BODY
urlread-onlystring
API endpoint to GET this object
html_urlread-onlystring
Web URL to view this object in Buddy.works
namestring
The pull request reference name (e.g., 'pull/5')
numberinteger
The pull request number
github_html_urlstring
The HTML URL to the pull request on GitHub
statestring
The state of the pull request (OPEN, CLOSED, MERGED)
titlestring
The title of the pull request
descriptionstring
The description of the pull request
basestring
The name of the base branch (the branch the changes are merged into)
headstring
The name of the head branch (the branch containing the changes)
head_shastring
The revision of the last commit on the head branch
draftboolean
Indicates whether the pull request is a draft
mergeablestring
Indicates whether the head branch can be merged into the base branch without conflicts (MERGEABLE, CONFLICTING, UNKNOWN)
aheadinteger
The number of commits on the head branch that are not on the base branch; empty when unknown
behindinteger
The number of commits on the base branch that are not on the head branch; empty when unknown
create_datestring
The date when the pull request was created
last_update_datestring
The date when the pull request was last updated
merged_datestring
The date when the pull request was merged
closed_datestring
The date when the pull request was closed
labelsstring[]
The labels assigned to the pull request

Constraints: Unique items required

assigneesstring[]
The logins of the users assigned to the pull request
reviewersstring[]
The logins of the users requested to review the pull request
originstring enum
The provider of the pull request: BUDDY for pull requests in repositories hosted in Buddy, otherwise the integrated Git provider
Allowed enum:
BUDDY,
GITHUB,
GITHUB_ENTERPRISE,
GITLAB,
GITLAB_ENTERPRISE,
BITBUCKET,
CUSTOM

Last modified on Sep 29, 2026

Request example

CURL
curl -X PUT "https://api.buddy.works/workspaces/:workspace/projects/:project_name/repository/pulls/:number/update-branch" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "Content-Type: application/json"
STATUS
200 OK