Ditrib

Documentation

The whole API fits on one page.

Four endpoints. Bearer token in a header. Everything speaks JSON except the upload itself, which takes a normal multipart form so curl is enough.

Authentication

Create a token in your account settings and send it on every request. Anonymous uploads are allowed on the free tier; omit the header and the 2 GB limit applies.

Authorization: Bearer dtk_live_<your-token>

Tokens are shown once. Rotating a token revokes the previous one after a five-minute overlap so running jobs do not fail mid-upload.

Upload a file

POST /v1/upload — multipart, field name file.

curl -H "Authorization: Bearer $DITRIB_TOKEN" \
     -F file=@release-2.4.1.tar.gz \
     -F expires=48h \
     -F max_downloads=25 \
     https://file.ditrib.online/v1/upload

Responds with the share link, the expiry and the digest:

{
  "id": "tr_8ZQ2m4Kd",
  "url": "https://file.ditrib.online/d/8ZQ2m4Kd",
  "bytes": 184733921,
  "sha256": "c9f0a6...e411",
  "expires_at": "2026-10-08T21:14:00Z",
  "downloads_remaining": 25
}

Resuming an interrupted upload

Large files should go through the chunked flow. Ask for a session, then PUT each chunk with a Content-Range header. Chunks may be sent in any order and retried individually.

curl -X POST -H "Authorization: Bearer $DITRIB_TOKEN" \
     -d '{"filename":"dump.sql.gz","bytes":9663676416}' \
     https://file.ditrib.online/v1/sessions

The response carries a session_id and the chunk size we want. Send GET /v1/sessions/<id> after a crash to learn which chunks already landed.

Inspect and revoke

MethodPathDoes
GET/v1/transfers/<id>Metadata, download count, expiry
PATCH/v1/transfers/<id>Change expiry or download cap
DELETE/v1/transfers/<id>Delete now; link starts returning 410

Errors and limits

Errors use the matching HTTP status with a short machine-readable code. Rate limits are returned in X-RateLimit-Remaining; a 429 always carries Retry-After.

StatusCodeMeaning
400bad_expiryExpiry outside the plan's retention window
401bad_tokenMissing, revoked or malformed token
409chunk_mismatchChunk digest did not match; resend that chunk
410expiredTransfer is gone, permanently
413too_largeFile exceeds the plan limit