Get checkpoint files

Changed on

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

Returns the source files saved in a checkpoint, so you can read the app's code as it was at that version or compare two versions.

The files are the app's editable source, such as its pages, components, backend functions and entity schemas, rather than every file in its repository. They come from the commit the checkpoint saved. A checkpoint saved before the app's code was kept in git is rebuilt from the copy it stored, which holds fewer files. That copy is also used when a newer checkpoint's commit can't be read and the checkpoint stored one.

Every file comes back in one response, so expect a large response for a big app.

Set branch_id to read one of a branch's checkpoints. A checkpoint is found only on its own line: leave branch_id out for main's checkpoints, and set it to the branch a branch checkpoint belongs to.

This is limited to 120 requests per minute per app for each workspace's personal API keys, so every key in a workspace shares one allowance. Some workspaces have a different limit.

<Note>This endpoint accepts a personal API key belonging to a user with editor access to the app, including a read-only key. Workspace API keys are not accepted.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>

get/api/apps/{app_id}/app-checkpoints/{checkpoint_id}/file-tree

Request

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

Path parameters

checkpoint_idstring required

ID of the checkpoint, as returned in id by List checkpoints.

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.

Response

The checkpoint's source files.

filesobject required

The checkpoint's source files, keyed by path. Pages, components, backend functions, entities and agents are keyed by kind and name with no file extension, such as pages/Home or functions/sendWelcomeEmail. A few files use a fixed name, such as layout. Entity, agent and workflow definitions come back as JSON objects, and source files as text.

Example response

{
  "files": {
    "entities/Task": {
      "name": "Task",
      "properties": {
        "title": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "functions/sendWelcomeEmail": "Deno.serve(async (req) => Response.json({ ok: true }));\n",
    "pages/Home": "export default function Home() {\n  return <h1>Welcome</h1>;\n}\n"
  }
}

Changes

    • info

      added the new optional query request parameter branch_id

    • info

      the security scope read_only was added to the endpoint's security scheme PersonalAccessTokenAuth

    • info

      the security scope full_access was removed from the endpoint's security scheme PersonalAccessTokenAuth