Inspect

Update session base branch

Update the base branch for a session's first repository. The branch must exist in the session repository. If the session already has an open pull request, its base branch is updated on GitHub as well. Only the session owner can update the base branch. Returns 400 when the branch or repository is invalid (including a branch that does not exist), 409 when the session's pull request is merged or closed, 502 when updating the pull request on GitHub fails, and 500 when the new base branch could not be saved.

Base URL
POST
/api/public/v1/sessions/{session_id}/update-base-branch

Update the base branch for a session's first repository. The branch must exist in the session repository. If the session already has an open pull request, its base branch is updated on GitHub as well. Only the session owner can update the base branch. Returns 400 when the branch or repository is invalid (including a branch that does not exist), 409 when the session's pull request is merged or closed, 502 when updating the pull request on GitHub fails, and 500 when the new base branch could not be saved.

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key authentication. Use your API key as the bearer token.

Path Parameters

session_id*string

The unique identifier of the session

Request Body

application/json
  1. body
new_base_branch*string

The new base branch. GitHub URL and ref prefixes such as refs/heads/ and origin/ are normalized.

Length1 <= length

Response Body

Base branch update result.

application/json
  1. response
data*
Example Request
curl -X POST 'https://your-org.inspect.com/api/public/v1/sessions/string/update-base-branch' \  -H 'Content-Type: application/json' \  -d '{  "new_base_branch": "string"}'
Example Response
{  "data": {    "success": true,    "message": "string",    "previous_base_branch": "string",    "new_base_branch": "string",    "pr_updated": true,    "repository": "string",    "pr_number": 0,    "needs_rebase": true  }}