Developers
Piggy Send API
Five endpoints cover upload, create, lookup, download and delete. All endpoints are POST with JSON bodies (except upload). Without a token, guest quota applies (1 GB, 7 days); send an API Token to use your account quota.
Download links are issued by the server after checking expiry and download count. All inputs are validated server-side, and quotas are enforced only on the server.
API Token
Add the X-Api-Key header to call the API with your account quota. Keep it secret — never commit it to a public repo.
/functions/uploadFileUpload a file
Upload one file as multipart/form-data and get back a file_uri. Quota is checked per file (guest 1 GB / signed-in 10 GB / Pro 1 TB); there is no total cap.
curl -X POST https://piggysend.com/functions/uploadFile \
-H "X-Api-Key: ps_xxx" \
-F "file=@./movie.mp4"{
"file_uri": "https://…/movie.mp4",
"name": "movie.mp4",
"size": 734003200,
"type": "video/mp4"
}/functions/createTransferCreate a transfer
Bundle uploaded files into one transfer with an expiry and download limit. The server validates each file size, the expiry and your transfer quota, then returns an unguessable short link.
curl -X POST https://piggysend.com/functions/createTransfer \
-H "Content-Type: application/json" \
-H "X-Api-Key: ps_xxx" \
-d '{
"title": "Weekend photos",
"message": "Check the last one!",
"files": [{ "name": "movie.mp4", "size": 734003200, "type": "video/mp4", "file_uri": "https://…" }],
"expires_in_days": 7,
"max_downloads": 10
}'{
"slug": "k3Jd9sLq2mXa7B",
"url": "https://piggysend.com/t/k3Jd9sLq2mXa7B",
"expires_at": "2026-09-11T06:50:00.000Z"
}/functions/getTransferGet transfer info
Fetch the public info of a transfer by slug: file names, sizes, downloads left, expiry and state.
curl -X POST https://piggysend.com/functions/getTransfer \
-H "Content-Type: application/json" \
-d '{ "slug": "k3Jd9sLq2mXa7B" }'{
"slug": "k3Jd9sLq2mXa7B",
"title": "Weekend photos",
"files": [{ "name": "movie.mp4", "size": 734003200, "type": "video/mp4" }],
"total_size": 734003200,
"max_downloads": 10,
"download_count": 2,
"expires_at": "2026-09-11T06:50:00.000Z",
"state": "active"
}/functions/downloadTransferGet download links
Returns download links after checking expiry and download count, and counts one download. Pass file_index for a single file, omit it for all files.
curl -X POST https://piggysend.com/functions/downloadTransfer \
-H "Content-Type: application/json" \
-d '{ "slug": "k3Jd9sLq2mXa7B", "file_index": 0 }'{
"files": [{ "name": "movie.mp4", "size": 734003200, "url": "https://…" }],
"expires_in": 300,
"download_count": 3
}/functions/deleteTransferDelete a transfer
Requires an API Token. Only the owner can delete a transfer; it stops working immediately and frees up quota.
curl -X POST https://piggysend.com/functions/deleteTransfer \
-H "Content-Type: application/json" \
-H "X-Api-Key: ps_xxx" \
-d '{ "slug": "k3Jd9sLq2mXa7B" }'{ "ok": true }