> ## Documentation Index
> Fetch the complete documentation index at: https://docs.base44.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update pull request

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Changes the title and description of a branch's open pull request on GitHub. This works on apps imported from GitHub, and on apps connected to GitHub whose main branch protection GitHub manages.

Send the branch as `branch_id`. `body` replaces the whole description, and Base44 keeps its footer at the end. Merged and closed pull requests can't be changed.

This endpoint is limited to 10 requests per minute per user, shared with Commit branch changes, Discard branch changes, Revert branch file changes and Open pull request, and reported in the `X-RateLimit-*` headers.

<Note>This endpoint accepts a personal API key or personal access token belonging to a user with editor access to the app. A read-only key is refused, and workspace API keys are not accepted. Send credentials in a header: an `api_key` query parameter is refused.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json patch /api/apps/{app_id}/imported/git/pull-request
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/imported/git/pull-request:
    patch:
      summary: Update pull request
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Changes the title and description of a branch's open pull request on
        GitHub. This works on apps imported from GitHub, and on apps connected
        to GitHub whose main branch protection GitHub manages.


        Send the branch as `branch_id`. `body` replaces the whole description,
        and Base44 keeps its footer at the end. Merged and closed pull requests
        can't be changed.


        This endpoint is limited to 10 requests per minute per user, shared with
        Commit branch changes, Discard branch changes, Revert branch file
        changes and Open pull request, and reported in the `X-RateLimit-*`
        headers.


        <Note>This endpoint accepts a personal API key or personal access token
        belonging to a user with editor access to the app. A read-only key is
        refused, and workspace API keys are not accepted. Send credentials in a
        header: an `api_key` query parameter is refused.</Note>


        <Warning>The response includes fields beyond the ones documented here.
        Don't rely on undocumented response fields, as they can change at any
        time.</Warning>
      operationId: update_pull_request_api_apps__app_id__imported_git_pull_request_patch
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app.
            title: App Id
          description: ID of the app.
          example: 6820f3a4e7b91d003c45a1f2
        - name: branch_id
          in: query
          required: false
          schema:
            type: string
            description: >-
              ID of the branch to work on, as returned by [List
              branches](/api-reference/list-branches). Omit it to work on the
              app's main branch.
            title: Branch Id
          description: >-
            ID of the branch to work on, as returned by [List
            branches](/api-reference/list-branches). Omit it to work on the
            app's main branch.
          example: 68f1a2b3c4d5e6f708192a3b
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePullRequestRequest'
      responses:
        '200':
          description: The updated pull request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PullRequest'
              example:
                number: 42
                title: Add checkout and cart
                body: Adds a checkout page.
                state: open
                merged: false
                draft: false
                html_url: https://github.com/acme/shop/pull/42
                changed_files: 3
                additions: 120
                deletions: 8
                head:
                  ref: feature/checkout
                  sha: 9fceb02d0ae598e95dc970b74767f19372d61af8
                base:
                  ref: main
                  sha: 9fceb02d0ae598e95dc970b74767f19372d61af8
        '401':
          description: >-
            `unauthenticated`: Missing or invalid credentials, or credentials
            sent as an `api_key` query parameter.
          content:
            application/json:
              examples:
                unauthenticated:
                  summary: unauthenticated
                  value:
                    error:
                      code: unauthenticated
                      message: 'Use Authorization: Bearer credentials.'
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '403':
          description: >-
            `forbidden`: You don't have editor access to this app, your API key
            is read-only, or you used a workspace API key.
          content:
            application/json:
              examples:
                forbidden:
                  summary: forbidden
                  value:
                    error:
                      code: forbidden
                      message: You don't have editor access to this app.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '404':
          description: >-
            `not_found`: The app or `branch_id` doesn't exist, or the app isn't
            one of the apps described above.
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    error:
                      code: not_found
                      message: Branch not found
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '409':
          description: >-
            `branch_required`: `branch_id` is missing. `branch_scope_read_only`:
            The branch is merged or closed. `pull_request_failed`: The pull
            request couldn't be changed, for example because your GitHub account
            can't push to the repository or GitHub refused the request;
            `message` says why. `pull_request_permission_missing` or
            `github_app_suspended`: Base44's GitHub App can't open pull requests
            on the repository; `details.recovery_url` links to where an owner
            fixes it. The `pull_request_failed` message also covers an empty
            `title`, a branch with no pull request, and a merged or closed pull
            request.
          content:
            application/json:
              examples:
                branch_required:
                  summary: branch_required
                  value:
                    error:
                      code: branch_required
                      message: Select a feature branch.
                      details: {}
                pull_request_failed:
                  summary: pull_request_failed
                  value:
                    error:
                      code: pull_request_failed
                      message: Merged pull requests cannot be updated
                      details:
                        reason: pull_request_failed
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '422':
          description: >-
            `invalid_request`: `title` is missing, or the body has a field that
            isn't `title` or `body`.
          content:
            application/json:
              examples:
                invalid_request:
                  summary: invalid_request
                  value:
                    error:
                      code: invalid_request
                      message: Invalid request
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '429':
          description: >-
            `rate_limited`: More than 10 requests in a minute. Retry after
            `Retry-After` seconds.
          content:
            application/json:
              examples:
                rate_limited:
                  summary: rate_limited
                  value:
                    error:
                      code: rate_limited
                      message: Rate limit exceeded.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '502':
          description: '`pull_request_unavailable`: GitHub couldn''t be reached. Retry later.'
          content:
            application/json:
              examples:
                pull_request_unavailable:
                  summary: pull_request_unavailable
                  value:
                    error:
                      code: pull_request_unavailable
                      message: Couldn’t reach GitHub. Try again.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    UpdatePullRequestRequest:
      properties:
        title:
          type: string
          title: Title
          description: New title of the pull request. It can't be empty.
          example: Add checkout and cart
        body:
          type: string
          title: Body
          description: >-
            New description of the pull request, in Markdown. It replaces the
            current one.
          default: ''
          example: Adds a checkout page and a cart.
      additionalProperties: false
      type: object
      required:
        - title
      title: UpdatePullRequestRequest
    PullRequest:
      properties:
        number:
          type: integer
          title: Number
          description: Pull request number on GitHub.
          example: 42
        title:
          type: string
          title: Title
          description: Title of the pull request.
          example: Add checkout flow
        body:
          anyOf:
            - type: string
            - type: 'null'
          title: Body
          description: Description of the pull request, or `null`.
          example: Adds a checkout page.
        state:
          type: string
          enum:
            - open
            - closed
          title: State
          description: '`open`, or `closed` once merged or closed.'
          example: open
        merged:
          type: boolean
          title: Merged
          description: Whether it was merged.
          example: false
        draft:
          type: boolean
          title: Draft
          description: Whether it's a draft.
          example: false
        html_url:
          type: string
          title: Html Url
          description: Link to the pull request on GitHub.
          example: https://github.com/acme/shop/pull/42
        changed_files:
          type: integer
          title: Changed Files
          description: Number of files it changes.
          example: 3
        additions:
          type: integer
          title: Additions
          description: Lines added.
          example: 120
        deletions:
          type: integer
          title: Deletions
          description: Lines removed.
          example: 8
        head:
          $ref: '#/components/schemas/GitRef'
          description: The branch the pull request merges from.
        base:
          $ref: '#/components/schemas/GitRef'
          description: The branch it merges into.
      type: object
      required:
        - number
        - title
        - body
        - state
        - merged
        - draft
        - html_url
        - changed_files
        - additions
        - deletions
        - head
        - base
      title: PullRequest
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    GitRef:
      properties:
        ref:
          type: string
          title: Ref
          description: Branch name.
          example: feature/checkout
        sha:
          type: string
          title: Sha
          description: Commit SHA the branch points to.
          example: 9fceb02d0ae598e95dc970b74767f19372d61af8
      type: object
      required:
        - ref
        - sha
      title: GitRef
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.