Create checkpoint

Changed on

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

Saves the app's current state as a new checkpoint, so you can return to it later with 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 rather than retrying blind.</Warning>

Saving a checkpoint starts its preview build in the background. Poll 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'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 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. A read-only key is refused, and workspace API keys are not accepted.</Note>

post/api/apps/{app_id}/app-checkpoints

Request

  • Base URL: https://app.base44.com
  • URL: https://app.base44.com/api/apps/{app_id}/app-checkpoints
  • Auth: HTTP bearer

Path parameters

app_idstring required

ID of the app.

Query parameters

branch_idstring

ID of the branch to work on, as returned by List branches. Omit it to work on the app's main branch.

Request body

namestring

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.

Example request

{
  "name": "Before pricing rework"
}

Response

Whether a checkpoint was saved, and its ID if one was.

createdboolean required

Whether a checkpoint was saved. false means the app has not changed since its most recent checkpoint, so there was nothing to save.

checkpoint_idstring nullable

ID of the checkpoint that was saved, or null when created is false. Pass it as checkpoint_id to Deploy an app to publish this version, or as checkpoint_id to Restore checkpoint to return to it.

reasonstring nullable

Why nothing was saved. no_changes is the only value, and it is null when created is true.

Example response

{
  "created": true,
  "checkpoint_id": "6886b8d390dc7e2f4a2c91b3",
  "reason": "no_changes"
}

Changes

    • breaking

      query request parameter branch_id list-of-types was narrowed by removing types null

    • info

      for the query request parameter branch_id, the type was generalized from no type to string

    • info

      added the new optional query request parameter branch_id