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 options
v3projectId stringrequired
Project identifier.
Possible values: Value must match regular expression ^prj_[A-Za-z0-9]+$
- application/json
- Body
- Example (auto)
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.
{
"path": "apps/clientportal-custom-app/pages",
"list": false
}
The file, or the folder's entries.
- application/json
- Schema
- Example (auto)
Schema
kindstringrequired
file carries the file's content; list the folder's entries.
Available options
filelistcontentstring
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 options
utf-8base64entriesobject[]
The folder's files and subfolders, sorted by name.
{
"kind": "file",
"content": "<template><h1>Welcome</h1></template>\n",
"bytes": 38,
"encoding": "utf-8",
"entries": [
{
"name": "welcome.vue",
"type": "file",
"bytes": 38
},
{
"name": "account",
"type": "directory"
}
]
}