Skip to main content
Version: 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.

Request​

Version stringrequired

The API version.

Available optionsv3
projectId stringrequired

Project identifier.

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

application/json

Bodyrequired

    pathstringrequired

    The file or folder, relative to the workspace root.

    listboolean

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

application/json

The file, or the folder's entries.

Schema
    kindstringrequired

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

    Available optionsfilelist
    contentstring

    The file's content, encoded as encoding says.

    bytesinteger

    The file's size in bytes.

    encodingstring

    base64 for a binary file, such as an image.

    Available optionsutf-8base64
    entriesobject[]

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