> ## 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.

# Get pull requests for branches

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

Returns the GitHub pull request for each named branch of an imported app's repository: the open one, or else the most recently merged one, whoever opened it. Branches with no pull request are left out. This works on apps imported from GitHub.

Send each branch name as its own `branch` parameter, up to 50 per call.

This endpoint is limited to 20 requests per minute per user, 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 get /api/apps/{app_id}/imported/git/pull-requests/by-branch
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-requests/by-branch:
    get:
      summary: Get pull requests for branches
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Returns the GitHub pull request for each named branch of an imported
        app's repository: the open one, or else the most recently merged one,
        whoever opened it. Branches with no pull request are left out. This
        works on apps imported from GitHub.


        Send each branch name as its own `branch` parameter, up to 50 per call.


        This endpoint is limited to 20 requests per minute per user, 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: >-
        pull_requests_by_branch_api_apps__app_id__imported_git_pull_requests_by_branch_get
      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
          in: query
          required: false
          schema:
            type: array
            items:
              type: string
            description: >-
              Name of a branch in the repository. Repeat it for each branch, up
              to 50.
            title: Branch
          description: >-
            Name of a branch in the repository. Repeat it for each branch, up to
            50.
          example:
            - feature/checkout
        - 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
      responses:
        '200':
          description: The named branches' pull requests.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BranchPullRequests'
              example:
                items:
                  feature/checkout:
                    number: 42
                    title: Add checkout flow
                    html_url: https://github.com/acme/shop/pull/42
                    head_branch: feature/checkout
                    merged: false
                    author_login: octocat
                    author_avatar_url: https://avatars.githubusercontent.com/u/583231?v=4
                    readiness:
                      checks: success
                      review: approved
                      mergeable: mergeable
        '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 doesn''t exist or isn''t an imported app.'
          content:
            application/json:
              examples:
                not_found:
                  summary: not_found
                  value:
                    error:
                      code: not_found
                      message: Imported repository not found.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '409':
          description: '`github_access_missing`: Base44 has no access to this repository.'
          content:
            application/json:
              examples:
                github_access_missing:
                  summary: github_access_missing
                  value:
                    error:
                      code: github_access_missing
                      message: Base44 has no access to this repository.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '422':
          description: '`too_many_branches`: More than 50 branch names.'
          content:
            application/json:
              examples:
                too_many_branches:
                  summary: too_many_branches
                  value:
                    error:
                      code: too_many_branches
                      message: At most 50 branches per lookup
                      details:
                        max: 50
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '429':
          description: >-
            `rate_limited`: More than 20 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_requests_unavailable`: GitHub couldn't be reached. Retry
            later.
          content:
            application/json:
              examples:
                pull_requests_unavailable:
                  summary: pull_requests_unavailable
                  value:
                    error:
                      code: pull_requests_unavailable
                      message: Couldn't read pull requests from GitHub. Try again.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    BranchPullRequests:
      properties:
        items:
          additionalProperties:
            $ref: '#/components/schemas/BranchPullRequestSummary'
          type: object
          title: Items
          description: >-
            Each branch's pull request, keyed by branch name. Branches with no
            pull request are left out.
          example:
            feature/checkout:
              author_login: octocat
              head_branch: feature/checkout
              html_url: https://github.com/acme/shop/pull/42
              merged: false
              number: 42
              title: Add checkout flow
      type: object
      required:
        - items
      title: BranchPullRequests
    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.
    BranchPullRequestSummary:
      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
        html_url:
          type: string
          title: Html Url
          description: Link to the pull request on GitHub.
          example: https://github.com/acme/shop/pull/42
        head_branch:
          anyOf:
            - type: string
            - type: 'null'
          title: Head Branch
          description: The branch it merges from, or `null` for a pull request from a fork.
          example: feature/checkout
        merged:
          type: boolean
          title: Merged
          description: Whether it was merged.
          example: false
        merged_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Merged At
          description: When it was merged, as an ISO 8601 UTC timestamp, or `null`.
          example: '2026-10-28T09:15:00Z'
        author_login:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Login
          description: GitHub login of the person who opened it.
          example: octocat
        author_avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Author Avatar Url
          description: URL of their GitHub avatar.
          example: https://avatars.githubusercontent.com/u/583231?v=4
        readiness:
          anyOf:
            - $ref: '#/components/schemas/PullRequestReadiness'
            - type: 'null'
          description: >-
            Whether it's ready to merge, or `null` when GitHub hasn't reported
            it yet.
      type: object
      required:
        - number
        - title
        - html_url
        - head_branch
        - merged
        - merged_at
        - author_login
        - author_avatar_url
        - readiness
      title: BranchPullRequestSummary
    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
    PullRequestReadiness:
      properties:
        checks:
          type: string
          enum:
            - success
            - pending
            - failure
            - none
            - unknown
          title: Checks
          description: Combined result of the pull request's CI checks.
          example: success
        review:
          type: string
          enum:
            - approved
            - changes_requested
            - required
            - none
            - unknown
          title: Review
          description: Review status.
          example: approved
        mergeable:
          type: string
          enum:
            - mergeable
            - conflicting
            - unknown
          title: Mergeable
          description: Whether GitHub can merge it without conflicts.
          example: mergeable
        unresolved_thread_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Unresolved Thread Count
          description: Review threads not resolved yet, or `null` when unknown.
          example: 0
      type: object
      required:
        - checks
        - review
        - mergeable
      title: PullRequestReadiness
  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.