Skip to main content

Upload a File

Upload a file’s raw bytes to the presigned URL returned by the Create or Update endpoints.
PUT <upload.url from create/update response>

Headers

HeaderRequiredDescription
Content-TypeYesMust match the content type from the upload object’s headers

Request Body

The raw file bytes. Do not wrap in JSON — send the file content directly.

Example

# Using the URL from the create response
curl -X PUT "https://simplehost.dev/api/v1/_upload/sites%2Fbright-canvas-a7k2%2F01jm4abc123%2Findex.html?token=abc123&ct=text%2Fhtml&exp=1711050000000" \
  -H "Content-Type: text/html" \
  --data-binary "@./dist/index.html"

Response (200)

Empty body on success.

Errors

StatusReason
400Upload URL has expired (1 hour TTL)
400No request body provided
500Upload to storage failed

Important Notes

Upload URLs expire after 1 hour. If they expire, you’ll need to create a new version by calling the publish endpoint again.
  • Upload all files listed in the uploads array before calling Finalize
  • Files in the skipped array (hash matches) do not need to be uploaded
  • Upload order doesn’t matter — you can upload files in parallel
  • The --data-binary flag is important when using curl — it preserves the raw bytes without any processing