curl -X POST https://api.buntime.sh/files/write \
-H "Authorization: Bearer $BUNTIME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "ses_abc123",
"path": "hello.ts",
"content": "console.log(\"Hello World!\");"
}'
await client.files.write({
sessionId: 'ses_abc123',
path: 'hello.ts',
content: 'console.log("Hello World!");'
});
{
"path": "hello.ts",
"size": 29
}
Files
Write File
Create or update a file in a session
POST
/
files
/
write
curl -X POST https://api.buntime.sh/files/write \
-H "Authorization: Bearer $BUNTIME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "ses_abc123",
"path": "hello.ts",
"content": "console.log(\"Hello World!\");"
}'
await client.files.write({
sessionId: 'ses_abc123',
path: 'hello.ts',
content: 'console.log("Hello World!");'
});
{
"path": "hello.ts",
"size": 29
}
Request
string
required
Session ID to write file in
string
required
File path relative to /workspace
string
required
File content (max 10MB on free tier, 50MB on paid)
string
required
Bearer token with your API key
Response
string
Path of written file
integer
File size in bytes
Example
curl -X POST https://api.buntime.sh/files/write \
-H "Authorization: Bearer $BUNTIME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "ses_abc123",
"path": "hello.ts",
"content": "console.log(\"Hello World!\");"
}'
await client.files.write({
sessionId: 'ses_abc123',
path: 'hello.ts',
content: 'console.log("Hello World!");'
});
{
"path": "hello.ts",
"size": 29
}