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

# Create checkpoint

> Saves the app's current state as a new [checkpoint](/developers/references/app-management/get-started/concepts#checkpoints), so you can return to it later with [Restore checkpoint](/api-reference/restore-checkpoint).

A checkpoint records the app's committed code, its entity schemas and its backend functions. Nothing is saved when the app has not changed since its most recent checkpoint: you get a 200 with `created` set to `false` and `reason` set to `no_changes`, and the checkpoint you already have stands.

<Warning>That check is not a guarantee against duplicates. Two requests in flight at the same time can both find nothing changed and both save a checkpoint, so retrying before the first request has finished can leave you with two. Send one at a time, and read [List checkpoints](/api-reference/list-checkpoints) rather than retrying blind.</Warning>

Saving a checkpoint starts its preview build in the background. Poll [List checkpoints](/api-reference/list-checkpoints) and watch the new checkpoint's `preview_status` to see when the preview is ready.

Set `branch_id` to work with a [branch](/developers/references/app-management/get-started/concepts#branches)'s checkpoints instead of main's. A branch has its own checkpoints and starts with none, so main's checkpoints from before the branch was created aren't included. A branch's checkpoints can't be deployed: [Deploy an app](/api-reference/deploy-an-app) works from main only. On a branch, a checkpoint records the branch's code, and the "has not changed" check compares it with the branch's own latest checkpoint, so a branch's first checkpoint is always saved.

<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
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:
    post:
      summary: Create checkpoint
      description: >-
        Saves the app's current state as a new
        [checkpoint](/developers/references/app-management/get-started/concepts#checkpoints),
        so you can return to it later with [Restore
        checkpoint](/api-reference/restore-checkpoint).


        A checkpoint records the app's committed code, its entity schemas and
        its backend functions. Nothing is saved when the app has not changed
        since its most recent checkpoint: you get a 200 with `created` set to
        `false` and `reason` set to `no_changes`, and the checkpoint you already
        have stands.


        <Warning>That check is not a guarantee against duplicates. Two requests
        in flight at the same time can both find nothing changed and both save a
        checkpoint, so retrying before the first request has finished can leave
        you with two. Send one at a time, and read [List
        checkpoints](/api-reference/list-checkpoints) rather than retrying
        blind.</Warning>


        Saving a checkpoint starts its preview build in the background. Poll
        [List checkpoints](/api-reference/list-checkpoints) and watch the new
        checkpoint's `preview_status` to see when the preview is ready.


        Set `branch_id` to work with a
        [branch](/developers/references/app-management/get-started/concepts#branches)'s
        checkpoints instead of main's. A branch has its own checkpoints and
        starts with none, so main's checkpoints from before the branch was
        created aren't included. A branch's checkpoints can't be deployed:
        [Deploy an app](/api-reference/deploy-an-app) works from main only. On a
        branch, a checkpoint records the branch's code, and the "has not
        changed" check compares it with the branch's own latest checkpoint, so a
        branch's first checkpoint is always saved.


        <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: create_checkpoint_api_api_apps__app_id__app_checkpoints_post
      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:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateManualCheckpointRequest'
              default:
                name: Manual Edits
      responses:
        '200':
          description: Whether a checkpoint was saved, and its ID if one was.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ManualCheckpointResponse'
        '400':
          description: >-
            The app has no committed code yet, so there is nothing to save. 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, 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.
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '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:
    CreateManualCheckpointRequest:
      properties:
        name:
          type: string
          title: Name
          description: >-
            Name for the checkpoint, shown in the app's version history. Send a
            non-empty value: an empty string is not stored, and the checkpoint
            is named after the app's most recent chat message instead.
          default: Manual Edits
          example: Before pricing rework
      type: object
      title: CreateManualCheckpointRequest
    ManualCheckpointResponse:
      properties:
        created:
          type: boolean
          title: Created
          description: >-
            Whether a checkpoint was saved. `false` means the app has not
            changed since its most recent checkpoint, so there was nothing to
            save.
          example: true
        checkpoint_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Checkpoint Id
          description: >-
            ID of the checkpoint that was saved, or `null` when `created` is
            `false`. Pass it as `checkpoint_id` to [Deploy an
            app](/api-reference/deploy-an-app) to publish this version, or as
            `checkpoint_id` to [Restore
            checkpoint](/api-reference/restore-checkpoint) to return to it.
          example: 6886b8d390dc7e2f4a2c91b3
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
          description: >-
            Why nothing was saved. `no_changes` is the only value, and it is
            `null` when `created` is `true`.
          example: no_changes
      type: object
      required:
        - created
      title: ManualCheckpointResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    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.