Write one source file
PUT
Creates or replaces one file of the working copy. A file over the plan's size limit, a tree over the file-count or size limit, or a workspace over its source limit is refused with 413 and the limit named. Nothing is billed for source storage yet; it is measured per day.
Requires an API key with the workspace:write 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.
application/json- body
path*stringThe file, relative to the project root, with / between folders; no leading slash and no . or .. parts.
Length
1 <= length <= 512content*stringThe file's content.
encoding?stringutf8 (the default) when content is the text itself, or base64 for a file that is not text.
Default
"utf8"Value in
"utf8""base64"The file written
application/json- response
file*created*booleantotalBytes*integerRange
0 <= valuecurl -X PUT "https://api.vlayers.ai/v1/agents/$AGENT_ID/source/file" \ -H "Authorization: Bearer $VOICELAYER_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "path": "src/index.ts", "content": "export const hello = 1;" }'Example Response
{ "file": { "path": "src/index.ts", "sizeBytes": 31, "sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", "updatedAt": "2026-10-20T15:04:05.000Z" }, "created": true, "totalBytes": 31}