Read one source file
GET
Reads one file of the working copy, or of a snapshot when you pass snapshotId. Text comes back as text; pass encoding=base64 for a file that is not text (a text read of one is refused with 422).
Requires an API key with the workspace:read scope.
apiKeyheader
AuthorizationBearer <token>A secret API key from the dashboard (Developers → API keys): vl_live_…, or vl_test_… for test mode. Each operation says which scope the key needs.
id*stringThe agent id.
path*stringThe file, relative to the project root, with / between folders.
Length
1 <= length <= 512snapshotId?stringRead the file as it was in this snapshot.
Format
uuidencoding?stringutf8 (the default) or base64.
Default
"utf8"Value in
"utf8""base64"The file, as text or base64
application/json- response
path*stringsizeBytes*integerRange
0 <= valuesha256*stringMatch
^[0-9a-f]{64}$encoding*stringValue in
"utf8""base64"content*stringcurl "https://api.vlayers.ai/v1/agents/$AGENT_ID/source/file?path=src/index.ts" \ -H "Authorization: Bearer $VOICELAYER_API_KEY"Example Response
{ "path": "src/index.ts", "sizeBytes": 31, "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "encoding": "utf8", "content": "export const hello = 'world';\n"}