---
title: "Get app code files"
method: POST
path: "/api/apps/{app_id}/code/content/batch"
---

# Get app code files

`POST /api/apps/{app_id}/code/content/batch`

## Request

- Base URL: `https://app.base44.com`
- URL: `https://app.base44.com/api/apps/{app_id}/code/content/batch`
- Auth: HTTP bearer

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

Returns the text of up to 32 files in the app's source in one call.

Get paths from [List app code files](/api-reference/list-app-code-files). `files` is keyed by each path as Base44 normalized it, so `./src/App.jsx` comes back as `src/App.jsx`, and a path you send twice comes back once. Each file holds either its `content` or an `error`, so one unreadable file doesn't fail the call. Only UTF-8 text files up to 5 MB can be read.

`max_bytes` caps the total size of the files returned. Files are read in the order you send them, and a file that would take the total over `max_bytes` comes back with the error `batch_limit_exceeded` and no content, while later files that still fit are read. Read the ones left out in another call. The other errors are `file_not_found`, `file_too_large` for a file over 5 MB, `not_text` for a folder or a file that isn't UTF-8 text, `file_forbidden`, `invalid_path` and `file_read_failed`.

A path outside the app, the app root, the app's `.git` folder and `.agents/.env` fail the whole call rather than a single file.

Reads come from the app's live sandbox, the same files the app editor shows, including changes that haven't been published yet. If no sandbox is running, the call starts one, so the first call after a quiet period takes noticeably longer than later ones.

Set `branch_id` to read a [branch](/developers/references/app-management/get-started/concepts#branches)'s files instead of main's. Each branch has its own sandbox, so the first read of a branch also takes longer. A merged branch can't be read: the call returns a 409. On an app imported from GitHub, reading a merged branch can instead return the files as they were when the branch was created, so don't rely on it there.

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. A read-only key is refused even though this endpoint only reads, and workspace API keys are not accepted.</Note>

## Path parameters

- `app_id` string, required: ID of the app whose code to read.

## Query parameters

- `branch_id` string: 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.

## Request body

- ReadBatch: The files to read.
  - `paths` string[], required: Paths of up to 32 files, relative to the app root.
  - `max_bytes` integer: Most bytes of file text to return across all the files, up to 5242880 (5 MB).

## Response `200`

Each file's text, or why it couldn't be read.

- BatchResult: The text of each file you asked for.
  - `files` object, required: Each file, keyed by its path relative to the app root.

## Other responses

- `400`: A path is empty, points outside the app, or is the app root.
- `401`: Missing or invalid credentials.
- `403`: You don't have editor access to this app, your API key is read-only, or you used a workspace API key, or a path is in the app's `.git` folder or is `.agents/.env`.
- `404`: App not found, or no branch you can see has this `branch_id`.
- `409`: The branch in `branch_id` was merged (`extra_data.reason` is `branch_not_active`).
- `422`: `paths` is missing, empty, or holds more than 32 paths, or `max_bytes` is outside 1 to 5242880.
- `429`: Rate limit exceeded. The base limit is 120 requests per minute. See [Rate limits](/developers/references/apps-api/get-started/rate-limits) for the multiplier your plan gets.

## Changes

- **2026-10-21** `c23775445de2`: 2 info
  - added the new optional `query` request parameter `branch_id`
  - added the non-success response with the status `409`
- **2026-10-11** `80287813ab84`: 1 info
  - the endpoint scheme security `PersonalAccessTokenAuth` was added to the API
- **2026-10-10** `fc604cdcc3a2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/idealspot/apis/base44-app-management-api/changes/api/apps/:app_id/code/content/batch/post.md)

---

[API](https://skmtc.dev/idealspot/apis/base44-app-management-api.md) - [All operations](https://skmtc.dev/idealspot/apis/base44-app-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/idealspot/apis/base44-app-management-api/revisions/b5b4ebd82a1e?raw)
