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

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Get main sandbox update status

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

Returns the state of the imported app's main sandbox: the preview that runs the branch the app was imported from, usually your repository's default branch.

When that branch moves, Base44 builds a new candidate at that commit, checks that its services come up healthy, and then switches the preview to it. `phase` says where that is, and `active_generation` is the commit the preview serves now. The editor asks for updates while the app is open in it. From CI or a script, call [Check for main sandbox updates](/api-reference/check-for-main-sandbox-updates) after a merge, then poll this endpoint.

`failure` describes the last build or verification failure of your repository's code. A `failed` phase can still come with a `null` `failure` when the cause was on Base44's side or during the app's first setup.

This endpoint is limited to 120 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>



## OpenAPI

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


        Returns the state of the imported app's main sandbox: the preview that
        runs the branch the app was imported from, usually your repository's
        default branch.


        When that branch moves, Base44 builds a new candidate at that commit,
        checks that its services come up healthy, and then switches the preview
        to it. `phase` says where that is, and `active_generation` is the commit
        the preview serves now. The editor asks for updates while the app is
        open in it. From CI or a script, call [Check for main sandbox
        updates](/api-reference/check-for-main-sandbox-updates) after a merge,
        then poll this endpoint.


        `failure` describes the last build or verification failure of your
        repository's code. A `failed` phase can still come with a `null`
        `failure` when the cause was on Base44's side or during the app's first
        setup.


        This endpoint is limited to 120 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>
      operationId: get_status_api_apps__app_id__imported_main_update_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the imported app whose main sandbox to read or update.
            title: App Id
          description: ID of the imported app whose main sandbox to read or update.
          example: 6820f3a4e7b91d003c45a1f2
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MainUpdateResponse'
        '401':
          description: >-
            `unauthenticated`: Missing or invalid credentials, or credentials
            sent as an `api_key` query parameter.
          content:
            application/json:
              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:
              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: Not found
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '429':
          description: >-
            `rate_limited`: More than 120 requests in a minute. Retry after
            `Retry-After` seconds.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
      security:
        - PersonalAccessTokenAuth:
            - full_access
components:
  schemas:
    MainUpdateResponse:
      properties:
        phase:
          type: string
          enum:
            - idle
            - preparing
            - building
            - verifying
            - publishing
            - retiring
            - failed
          description: >-
            Where the update is: `idle` when nothing is running, `preparing`,
            `building`, `verifying` and `publishing` while a commit moves to the
            preview, `retiring` while an old build is removed, and `failed` when
            the last update failed.
          example: idle
        active_generation:
          anyOf:
            - $ref: '#/components/schemas/ActiveGenerationResponse'
            - type: 'null'
          description: The build the preview serves now, or `null` before the first one.
        failure:
          anyOf:
            - $ref: '#/components/schemas/FailureResponse'
            - type: 'null'
          description: >-
            The last failure in your repository's code, or `null` when there's
            none to act on.
        initial_setup_pending:
          type: boolean
          title: Initial Setup Pending
          description: >-
            `true` while the app's first setup is still pending. Updates don't
            run until it finishes.
          default: false
          example: false
      type: object
      required:
        - phase
        - active_generation
        - failure
      title: MainUpdateResponse
    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.
    ActiveGenerationResponse:
      properties:
        id:
          type: string
          title: Id
          description: ID of the build the preview serves.
          example: 5f1c0e2a9b7d4c3e8a6f1b2d3c4e5f60
        commit:
          type: string
          title: Commit
          description: Git commit SHA the preview serves.
          example: 9fceb02d0ae598e95dc970b74767f19372d61af8
      type: object
      required:
        - id
        - commit
      title: ActiveGenerationResponse
    FailureResponse:
      properties:
        id:
          type: string
          title: Id
          description: ID of the failure.
          example: 0d4c2b1a9e8f7a6b5c4d3e2f1a0b9c8d
        commit:
          type: string
          title: Commit
          description: Git commit SHA that failed.
          example: 1a2b3c4d5e6f708192a3b4c5d6e7f8091a2b3c4d
        stage:
          type: string
          title: Stage
          description: >-
            Step that failed, such as `build` or `verification` (the health
            checks).
          example: verification
        diagnostics:
          type: string
          title: Diagnostics
          description: Short reason for the failure. It isn't a stable contract.
          example: The web service didn't become healthy.
        investigation_branch_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Investigation Branch Id
          description: >-
            ID of the branch where Base44 is fixing the failure, or `null` when
            no fix was started.
      type: object
      required:
        - id
        - commit
        - stage
        - diagnostics
        - investigation_branch_id
      title: FailureResponse
    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.