Skip to main content
Upload a file to the sandbox filesystem using multipart form data.

Basic Request

curl -X POST https://api.gravixlayer.com/v1/agents/sandboxes/{sandbox_id}/files/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "file=@/path/to/local/file.txt" \
  -F "path=/home/user/uploaded_file.txt"

Request Parameters

ParameterTypeRequiredDescription
filebinaryYesFile to upload (multipart form data)
pathstringYesDestination path in sandbox

Response

{
  "message": "File uploaded successfully",
  "path": "/home/user/uploaded_file.txt",
  "size": 2048
}

Response Fields

FieldTypeDescription
messagestringSuccess message
pathstringUploaded file path in sandbox
sizeintegerFile size in bytes

Example: Upload Image

curl -X POST https://api.gravixlayer.com/v1/agents/sandboxes/{sandbox_id}/files/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "path=/home/user/images/uploaded_image.png"

Example: Upload to Directory

curl -X POST https://api.gravixlayer.com/v1/agents/sandboxes/{sandbox_id}/files/upload \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "[email protected]" \
  -F "path=/home/user/data/dataset.csv"

Supported File Types

  • Text files: .txt, .csv, .json, .xml
  • Images: .png, .jpg, .gif, .svg
  • Documents: .pdf, .docx, .xlsx
  • Code files: .py, .js, .html, .css
  • Archives: .zip, .tar.gz

Next Steps