Skip to content

close_pull_request

Close an open pull request without merging it. Requires at least Editor role. Pass expected_updated_at from get_pull_request to reject the close 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 mutation occurs.

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
expected_updated_atAnnotated[str, Field(description='Optional updated_at value observed from get_pull_request. Closing 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. Closing 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)
  • state (string)
  • merged (boolean)
  • closed (boolean)
  • changed (boolean)
  • message (string)

See the response example below for the full payload shape.

{
"name": "close_pull_request",
"arguments": {
"model_name": "forecasts",
"pull_request_id": 42,
"expected_updated_at": "2026-04-28T10:00:00+00:00",
"expected_head_sha": "def456abc123"
}
}
{
"model": "forecasts",
"pull_request_id": 42,
"state": "closed",
"merged": false,
"closed": true,
"changed": true,
"message": "Pull request #42 closed."
}
  • Module: Pull Requests
  • Requires authentication via API token or Auth0 JWT.