Skip to content

update_pull_request

Update the title and/or body of an open pull request. Requires at least Editor role. Pass expected_updated_at from get_pull_request to reject the update if PR metadata changed since it was read, and expected_head_sha to reject it if the head branch received new commits. Stale expected state fails without mutation. Calling this on a closed or merged PR is idempotent: changed=false is returned and no update is applied.

NameTypeRequiredDefaultDescription
model_nameAnnotated[str, Field(description='Name of the Bridge Town model.')]Yes
pull_request_idAnnotated[int, Field(description='Numeric ID of the pull request within the model.')]Yes
title`Annotated[strNone, Field(description=‘Replacement PR title. Omit to leave the title unchanged.’)]`NoNone
body`Annotated[strNone, Field(description=‘Replacement PR body. Omit to leave the body unchanged.’)]`NoNone
expected_updated_atAnnotated[str, Field(description='Optional updated_at value observed from get_pull_request. The update fails without mutation if the PR metadata changed since it was read.')]No''
expected_head_shaAnnotated[str, Field(description='Optional head_sha observed from get_pull_request. The update fails without mutation if new commits were pushed to the PR branch.')]No''
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

Returns a structured object. Top-level fields:

  • model (string)
  • pull_request_id (integer)
  • title (string)
  • body (string)
  • state (string)
  • merged (boolean)
  • changed (boolean)
  • message (string)

See the response example below for the full payload shape.

{
"name": "update_pull_request",
"arguments": {
"model_name": "forecasts",
"pull_request_id": 42,
"title": "Aggressive growth scenario — revised",
"body": "Bumps growth_rate from 10% to 15% and documents downside sensitivity.",
"expected_updated_at": "2026-04-28T10:00:00+00:00",
"expected_head_sha": "def456abc123"
}
}
{
"model": "forecasts",
"pull_request_id": 42,
"title": "Aggressive growth scenario — revised",
"body": "Bumps growth_rate from 10% to 15% and documents downside sensitivity.",
"state": "open",
"merged": false,
"changed": true,
"message": "Pull request #42 updated."
}
  • Module: Pull Requests
  • Requires authentication via API token or Auth0 JWT.