Skip to main content
Returns a short-lived URL to PUT the file bytes to. The file never passes through the Dreep API, which makes this the right path for large files, and the only safe way to upload from a browser, since your API key stays on your server.

Signature

PresignOptions

Returns

The upload URL is single-use and valid for 10 minutes. Until ConfirmUpload is called the asset stays pending and is excluded from media listings.
The PUT must use the exact ContentType and SizeBytes you presigned with. See Uploading Media for the underlying HTTP flow.

One call: UploadPresigned

When the bytes are on your server, UploadPresigned runs presign, PUT and confirm for you. It skips the PUT when ContentHash matches existing content, and retries the confirm step on 409 while the bytes settle.

Browser uploads

For a browser, split the flow: your Go handler presigns, the browser PUTs, and a second handler confirms.
The browser then sends the bytes and calls your confirm endpoint:

Skipping duplicate uploads

Pass the file’s SHA-256 as ContentHash. If Dreep already stores that content, AlreadyExists is true and UploadURL is empty — skip the PUT and confirm directly.