Public API Reference
Upload supported files and create temporary short links from your own client.
https://api.selfgonefile.com as the API base URL. Treat every returned identifier and token as an opaque value; do not parse or modify it.Authentication
File uploads and short-link creation support anonymous use for one day, one week and one month. No API key is required for those durations.
An authenticated request may include Authorization: Bearer <access-token> to associate the result with the account. The 12m file duration and TWELVE_MONTHS short-link validity require an authenticated account.
Never place access tokens, upload tokens or deletion URLs in logs, analytics, source code or public messages.
Supported files and size limits
- Images:
.jpg,.jpeg,.png,.gif,.webp - Videos:
.mp4,.webm - Archives:
.zip,.7z,.gz,.rar
The filename extension, declared media type and actual file content must agree. Renaming an unsupported file does not make it valid.
| File size | Required flow |
|---|---|
| Up to 90 MiB | Simple upload is recommended |
| More than 90 MiB, up to 250 MiB | Multipart upload is required |
| More than 250 MiB | Rejected |
The simple endpoint has a 99 MiB hard limit. Switching at 90 MiB provides a stable client boundary.
Simple file upload
POST/api/upload
Send multipart/form-data with these fields:
file— required binary file.storage_duration— one of1d,1w,1mor12m.
curl https://api.selfgonefile.com/api/upload \ -F "file=@./example.png" \ -F "storage_duration=1w"
An authenticated twelve-month request also adds:
-H "Authorization: Bearer <access-token>"
Multipart file upload
Use this flow for files larger than 90 MiB. A successful session must be completed explicitly.
POST
/api/uploads/multipartSend JSON containing
filename, integersizeBytes,declaredMimeandduration.{ "filename": "example.mp4", "sizeBytes": 125829120, "declaredMime": "video/mp4", "duration": "1w" }PUT
/api/uploads/multipart/{uploadId}/parts/{partNumber}Send each part as
application/octet-stream, starting at part 1. Include the exactContent-Length,X-Upload-Tokenand lowercase hexadecimalX-Part-SHA256.GET
/api/uploads/multipart/{uploadId}Include
X-Upload-Tokento retrieve confirmed part numbers before resuming.POST
/api/uploads/multipart/{uploadId}/completeInclude
X-Upload-Token. Complete only after every part has been confirmed.DELETE
/api/uploads/multipart/{uploadId}Include
X-Upload-Tokento cancel an unfinished session.
The initiation response provides uploadId, uploadToken, partSizeBytes, totalParts and expiresAt. Follow those returned values exactly. Do not invent part sizes or persist the upload token beyond the active session.
Successful file response
Simple upload and multipart completion return the same public result:
{
"id": "aB3dE7x",
"file": "https://api.selfgonefile.com/api/v/aB3dE7x.png",
"viewfile": "https://selfgonefile.com/view/aB3dE7x.png",
"thumbnail": "https://api.selfgonefile.com/api/v/aB3dE7x/thumb",
"delete": "https://api.selfgonefile.com/api/v/aB3dE7x/delete?token=<deletion-token>"
}viewfileis the shareable viewer page.fileis the direct file URL.thumbnailisnullfor archives.deleteis a secret capability URL. Anyone holding it can delete the resource.
Create a short link
POST/api/short-links
Send application/json:
{
"destinationUrl": "https://example.com/article",
"validity": "ONE_WEEK",
"captchaRequired": false,
"password": "optional-password"
}destinationUrlmust be an absolute public HTTP or HTTPS URL, no longer than 2048 characters.validityacceptsONE_DAY,ONE_WEEK,ONE_MONTHor authenticated-onlyTWELVE_MONTHS.captchaRequiredis required and must be a boolean.passwordis optional; when present it must contain 8–128 characters.- A SelfGoneFile short URL cannot be shortened again.
{
"success": true,
"shortLink": {
"id": "3fa09bc",
"shortUrl": "https://selfgonefile.com/s/3fa09bc",
"expiresAt": "2026-09-04T12:00:00.000Z",
"passwordRequired": true,
"captchaRequired": false
}
}Share the returned shortUrl. When protection is enabled, the public page requests the required verification before redirecting.
Limits, retries and errors
- New upload requests are rate limited per client. Current responses include standard
RateLimit-*headers; treat those headers as authoritative. - At most three unfinished multipart sessions may be active per client or account.
- Retry network failures,
408,429and5xxresponses only. RespectRetry-Afterand use bounded retries. - Do not retry other
4xxresponses without correcting the request.
| Status | Meaning |
|---|---|
400 | Malformed request, unsupported content or inconsistent metadata |
401 | Invalid or expired access token |
403 | Authentication or a valid capability is required |
409 | Conflicting multipart operation |
410 | Multipart session expired or is no longer active |
413 | Payload exceeds the endpoint limit |
429 | Rate limit reached; wait before retrying |
500 / 503 | Temporary service failure; retry with backoff |
Support
Questions about the public contract: [email protected]
