Skip to main content
Client App BuilderVersion: v3

Read a file in the app's sandbox, or list a folder.

POST/ai-builder-api/cli/projects/{projectId}/sandbox/view

Reads one file of the app's code, or lists a folder's files and subfolders, so an agent sees what is there before it edits. A folder path always lists. The kernel's own files are readable; the writable boundary applies only to POST .../sandbox/edit.

Authorizations

Authorizationstringheaderrequired

Bearer authentication header of the form Bearer <token>, where <token> is your access token.

Scope:clientportal-ai.readonly
Auth methods:OAuthPrivate Integration
Token type:Sub-Account Token

Request​

Headers

Versionstringrequired

The API version.

Available optionsv3
Example:v3

Path Parameters

projectIdstringrequired

Project identifier.

Possible values: Value must match regular expression ^prj_[A-Za-z0-9_-]+$

Example:prj_01HXQ8Z6J9K2

Body

pathstringrequired

The file or folder, relative to the workspace root.

Example:apps/clientportal-custom-app/pages
listboolean

List the path even when it is a file's folder; a folder path lists either way.

Example:false

Response

The file, or the folder's entries.

kindstringrequired

file carries the file's content; list the folder's entries.

Available optionsfilelist
Example:file
contentstring

The file's content, encoded as encoding says.

Example:<template><h1>Welcome</h1></template>
bytesinteger

The file's size in bytes.

Example:38
encodingstring

base64 for a binary file, such as an image.

Available optionsutf-8base64
Example:utf-8
entriesobject[]

The folder's files and subfolders, sorted by name.