The Apps API is in beta. Its endpoints and responses may change.
Saving files or using the sandbox
Pick the route by how you want the change applied.- Saving files with Save an app file works like saving in the code editor. Base44 writes the file and applies what its path implies. A backend function is redeployed, and an entity or agent schema is validated. Save several app files saves up to 50 files in one call and never deploys.
- The sandbox endpoints run against the app’s live sandbox, the same filesystem the app editor edits, so a change shows up in the editor immediately. Use them to run shell commands and to read, write, edit, and search files.
Reading code
List app code files returns the paths in the app’s source, the same list the code editor’s file tree shows. Get an app code file returns one file’s text. Both read from the app’s live sandbox, so they include changes that haven’t been published yet. If no sandbox is running, the call starts one, and the first call after a quiet period takes noticeably longer.Endpoints
Saving files
- Save an app file: Save one file the way the code editor does.
- Save several app files: Save up to 50 files in one call, without deploying.
Sandbox
- Run a sandbox command: Run a shell command in the app’s sandbox and get its output.
- Read app files: Read one or more files, or a range of lines.
- Write an app file: Create a file or replace one.
- Edit an app file: Apply exact-string edits to a file and get the diff.
- Search app files: Search the app’s files for a pattern.
- List app files: List the files and directories in the sandbox.
- Create a sandbox checkpoint: Save the app’s current state so you can return to it.
Source code
- List app code files: List the paths of the files in the app’s source.
- Get an app code file: Read the text of one source file.
- Set main branch protection: Turn protection of the main branch on or off.
Backend functions
- Redeploy a backend function: Deploy code you send as one of the app’s backend functions.
- Get backend function logs: Read recent log lines from a backend function.