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

# Retry checkpoint build

> Starts a new preview build for a [checkpoint](/developers/references/app-management/get-started/concepts#checkpoints) and returns without waiting for it to finish.

Use it when a checkpoint's `preview_status` in [List checkpoints](/api-reference/list-checkpoints) is `failed`. It works on a checkpoint in any state. When the checkpoint's commit already has a build, nothing is rebuilt and the checkpoint is marked `ready` straight away.

The build runs in the background. Poll [List checkpoints](/api-reference/list-checkpoints) and watch the checkpoint's `preview_status` until it's `ready` or `failed`. Build failures can include details in `build_error.message`.

Only one build of a commit runs at a time. Retrying while another build of the same commit is still running doesn't start a second one in parallel. The retry waits for that build and only builds again if it didn't succeed. If the wait expires without a completed build, the checkpoint stays `building` while it's within the build execution budget. Once more than 20 minutes have passed since the latest checkpoint update or build start, listing checkpoints checks for a completed build and marks the checkpoint `ready` or `failed`. If build availability can't be checked, its status stays unchanged. You can retry a failed checkpoint's build.

<Warning>A checkpoint whose `git_commit_hash` is `null` was saved before the app's code was kept in git. Retrying its build first saves that checkpoint's code to the app as a new commit, which changes the app's current code. On a branch, such a checkpoint can't be rebuilt and returns a 400.</Warning>

Set `branch_id` to rebuild one of a [branch](/developers/references/app-management/get-started/concepts#branches)'s checkpoints.

<Note>This endpoint accepts a personal API key or a workspace API key, which acts as the workspace owner. A read-only key is refused.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json post /api/apps/{app_id}/app-checkpoints/{checkpoint_id}/retry-build
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}/app-checkpoints/{checkpoint_id}/retry-build:
    post:
      summary: Retry checkpoint build
      description: >-
        Starts a new preview build for a
        [checkpoint](/developers/references/app-management/get-started/concepts#checkpoints)
        and returns without waiting for it to finish.


        Use it when a checkpoint's `preview_status` in [List
        checkpoints](/api-reference/list-checkpoints) is `failed`. It works on a
        checkpoint in any state. When the checkpoint's commit already has a
        build, nothing is rebuilt and the checkpoint is marked `ready` straight
        away.


        The build runs in the background. Poll [List
        checkpoints](/api-reference/list-checkpoints) and watch the checkpoint's
        `preview_status` until it's `ready` or `failed`. Build failures can
        include details in `build_error.message`.


        Only one build of a commit runs at a time. Retrying while another build
        of the same commit is still running doesn't start a second one in
        parallel. The retry waits for that build and only builds again if it
        didn't succeed. If the wait expires without a completed build, the
        checkpoint stays `building` while it's within the build execution
        budget. Once more than 20 minutes have passed since the latest
        checkpoint update or build start, listing checkpoints checks for a
        completed build and marks the checkpoint `ready` or `failed`. If build
        availability can't be checked, its status stays unchanged. You can retry
        a failed checkpoint's build.


        <Warning>A checkpoint whose `git_commit_hash` is `null` was saved before
        the app's code was kept in git. Retrying its build first saves that
        checkpoint's code to the app as a new commit, which changes the app's
        current code. On a branch, such a checkpoint can't be rebuilt and
        returns a 400.</Warning>


        Set `branch_id` to rebuild one of a
        [branch](/developers/references/app-management/get-started/concepts#branches)'s
        checkpoints.


        <Note>This endpoint accepts a personal API key or a workspace API key,
        which acts as the workspace owner. A read-only key is refused.</Note>
      operationId: >-
        retry_checkpoint_build_api_apps__app_id__app_checkpoints__checkpoint_id__retry_build_post
      parameters:
        - name: checkpoint_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the checkpoint, as returned in `id` by [List
              checkpoints](/api-reference/list-checkpoints).
            title: Checkpoint Id
          description: >-
            ID of the checkpoint, as returned in `id` by [List
            checkpoints](/api-reference/list-checkpoints).
          example: 6886b8d390dc7e2f4a2c91b3
        - 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
      responses:
        '200':
          description: Where the build stands, and the commit being built.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RetryCheckpointBuildResponse'
        '400':
          description: >-
            The checkpoint has no commit to build. On an app imported from
            GitHub, a `branch_id` whose branch is the repository's default
            branch also answers 400 with `extra_data.reason`
            `invalid_branch_name`.
        '401':
          description: Missing or invalid credentials.
        '403':
          description: You don't have access to this app, or your API key is read-only.
        '404':
          description: >-
            App not found, the app has no checkpoint with this ID on main or on
            the branch in `branch_id`, or no branch you can see has this
            `branch_id`.
        '409':
          description: >-
            The app's main line is protected, so its state can't be changed
            directly. With `branch_id`, the branch was merged
            (`branch_scope_read_only`) or is being updated from main
            (`branch_sync_in_progress`), as `extra_data.reason` says.
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - full_access
        - WorkspaceApiKeyAuth:
            - full_access
        - WorkspaceApiKeyBearerAuth:
            - full_access
components:
  schemas:
    RetryCheckpointBuildResponse:
      properties:
        status:
          type: string
          enum:
            - building
            - ready
            - skipped
          title: Status
          description: >-
            Where the build stands when the call returns. Either `building` (the
            build started in the background), `ready` (the checkpoint's commit
            was already built, so nothing was rebuilt), or `skipped` (the app
            was imported from an external repository, and those apps have no
            preview build).
          example: building
        git_commit_hash:
          type: string
          title: Git Commit Hash
          description: >-
            Git commit hash of the code being built, the same as the
            checkpoint's `git_commit_hash`.
          example: a1b2c3d4e5f67890abcdef1234567890abcdef12
      type: object
      required:
        - status
        - git_commit_hash
      title: RetryCheckpointBuildResponse
      description: Where a checkpoint's preview build stands when the call returns.
    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`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

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