---
title: "Get an app code file"
method: GET
path: "/api/apps/{app_id}/code/content"
---

# Get an app code file

`GET /api/apps/{app_id}/code/content`

## Request

- Base URL: `https://app.base44.com`
- URL: `https://app.base44.com/api/apps/{app_id}/code/content`
- 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 one file in the app's source.

Get paths from [List app code files](/api-reference/list-app-code-files). A file that list leaves out, such as `package-lock.json`, can still be read by naming it.

Only UTF-8 text files up to 5 MB can be read. A path outside the app is refused, and so are the app's `.git` folder and `.agents/.env`, which Base44 manages and which can hold credentials.

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 300 requests a 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, including a read-only one, from anyone with access to the app, viewers included. Workspace API keys are not authorized for it.</Note>

## Path parameters

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

## Query parameters

- `path` string, required: Path of the file, relative to the app root.
- `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.

## Response `200`

The file's text.

- FileContent: One file's text.
  - `path` string, required: Path of the file, relative to the app root.
  - `content` string, required: The file's full text.

## Other responses

- `400`: `path` is empty, points outside the app, or is the app root.
- `401`: Missing or invalid credentials.
- `403`: You don't have access to this app, you used a workspace API key, or `path` is in the app's `.git` folder or is `.agents/.env`.
- `404`: App not found, there's no file at `path`, 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`).
- `413`: The file is larger than 5 MB.
- `415`: The file isn't UTF-8 text, or `path` is a folder.
- `422`: `path` is missing.
- `429`: Too many requests for this app in the last minute from personal API keys in your workspace.

## 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-09-30** `63675fa5257c`: 1 info
  - endpoint added

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

---

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