Skip to main content
POST
https://api.buntime.sh
/
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!\");"
  }'
{
  "path": "hello.ts",
  "size": 29
}

Request

sessionId
string
required
Session ID to write file in
path
string
required
File path relative to /workspace
content
string
required
File content (max 10MB on free tier, 50MB on paid)
Authorization
string
required
Bearer token with your API key

Response

path
string
Path of written file
size
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!\");"
  }'
{
  "path": "hello.ts",
  "size": 29
}