Skip to Content
Homemade
Dashboard

Write a file

PUT
/api/sandboxes/{sandboxId}/files

Writes a file in the sandbox (text, or base64 for bytes), making its folders. Replaces a file already there. At most 10 MB.

Authorization

apiKey
headerAuthorizationBearer <hmk_…>

An API key from the dashboard or homemade api-key create.

Path Parameters

sandboxId*string

Request Body

application/json
  1. body
content*string

The file's content, as text or base64 (see encoding).

encoding?string
Default"utf-8"
Value in"utf-8""base64"
path*string

Absolute, or relative to the sandbox's home directory.

Length1 <= length <= 4096

Response Body

Written.

application/json
  1. response
path*string
size*integer
Range0 <= value <= 9007199254740991
Example Request
curl -X PUT 'https://api.homemade.dev/api/sandboxes/string/files' \  -H 'Content-Type: application/json' \  -d '{  "content": "string",  "path": "string"}'
Example Response
{  "path": "string",  "size": 0}