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

# Investigate main sandbox update failure

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

Asks Base44's AI to investigate a failed main sandbox update and fix it on a new branch, and returns the branch's ID. The AI works like a builder message on that branch and consumes credits the same way. It doesn't merge anything; review the branch and merge it with [Merge branch](/api-reference/merge-branch).

Each failure gets one investigation. Calling this again for the same failure returns the same branch without starting another. A failure during the app's first setup can't be investigated this way.

This endpoint is limited to 10 requests per minute per user, shared with [Retry main sandbox update](/api-reference/retry-main-sandbox-update), 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>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/imported/main-update/failures/{failure_id}/investigations
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/main-update/failures/{failure_id}/investigations:
    post:
      summary: Investigate main sandbox update failure
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Asks Base44's AI to investigate a failed main sandbox update and fix it
        on a new branch, and returns the branch's ID. The AI works like a
        builder message on that branch and consumes credits the same way. It
        doesn't merge anything; review the branch and merge it with [Merge
        branch](/api-reference/merge-branch).


        Each failure gets one investigation. Calling this again for the same
        failure returns the same branch without starting another. A failure
        during the app's first setup can't be investigated this way.


        This endpoint is limited to 10 requests per minute per user, shared with
        [Retry main sandbox update](/api-reference/retry-main-sandbox-update),
        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>
      operationId: >-
        investigate_api_apps__app_id__imported_main_update_failures__failure_id__investigations_post
      parameters:
        - name: failure_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the failure, as `failure.id` in [Get main sandbox update
              status](/api-reference/get-main-sandbox-update-status).
            title: Failure Id
          description: >-
            ID of the failure, as `failure.id` in [Get main sandbox update
            status](/api-reference/get-main-sandbox-update-status).
          example: 0d4c2b1a9e8f7a6b5c4d3e2f1a0b9c8d
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the imported app whose main sandbox update failed.
            title: App Id
          description: ID of the imported app whose main sandbox update failed.
          example: 6820f3a4e7b91d003c45a1f2
      responses:
        '202':
          description: The investigation's branch.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InvestigationResponse'
              example:
                branch_id: 6886b8d390dc7e2f4a2c91b3
        '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, isn't an imported app, or main
            sandbox updates aren't enabled for it. `failure_not_found`: There's
            no failure with this ID.
          content:
            application/json:
              examples:
                failure_not_found:
                  summary: failure_not_found
                  value:
                    error:
                      code: failure_not_found
                      message: Update failure not found
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '409':
          description: >-
            `setup_repaired_on_main`: The failure happened during the app's
            first setup. `repository_changed`: The app is connected to a
            different repository than the one that failed.
          content:
            application/json:
              examples:
                setup_repaired_on_main:
                  summary: setup_repaired_on_main
                  value:
                    error:
                      code: setup_repaired_on_main
                      message: >-
                        Initial setup is repaired on Main. Ask the builder to
                        fix it there.
                      details: {}
                repository_changed:
                  summary: repository_changed
                  value:
                    error:
                      code: repository_changed
                      message: The repository connection has changed
                      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'
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    InvestigationResponse:
      properties:
        branch_id:
          type: string
          title: Branch Id
          description: ID of the branch where Base44 is fixing the failure.
          example: 6886b8d390dc7e2f4a2c91b3
      type: object
      required:
        - branch_id
      title: InvestigationResponse
    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.
    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.