Skip to content

Write a file

View .md
PUT

Create or replace a file. Up to 5 MiB.

Authorization

  • Authorizationheaderrequired

    Bearer YOUR_API_KEY. Create a key in the dashboard.

Path parameters

  • sandboxIdstringrequired

    Sandbox ID.

Body

application/json

  • pathstringrequired

    Absolute, or relative to /home/user. Must resolve under /home/user or /tmp.

  • contentstringrequired

    Up to 5 MiB after decoding.

  • encodingstring

    Use base64 for binary files.

    One ofutf8base64
    Defaultutf8

Responses

200Written.
  • fileobjectrequired
    4 properties
    • pathstringrequired
    • contentstring

      Present on read.

    • encodingstring
      One ofutf8base64
    • sizeintegerrequired

      Bytes.

400Invalid body or path.
  • codestringrequired
  • messagestringrequired
  • detailsobject
401Unauthorized.
  • codestringrequired
  • messagestringrequired
  • detailsobject
404Sandbox not found, or it belongs to another project.
  • codestringrequired
  • messagestringrequired
  • detailsobject
409`sandbox_not_running`: the sandbox is stopped, stopping, failed or deleted; resume it first. `sandbox_not_ready`: it is still starting and did not become ready in time; retry.
  • codestringrequired
  • messagestringrequired
  • detailsobject
413`file_too_large`: the content is larger than 5 MiB.
  • codestringrequired
  • messagestringrequired
  • detailsobject