Public API

CodeDrop API

Public endpoints for uploading files, notes, and links without login, then retrieving them by an 8-character code.

Base URL

https://cds.unidrac.com

Authentication

No API key or login is required for the public endpoints on this page.

Public Limits

Unauthenticated uploads are limited to 250 MB. HTML notes are limited to 5 MB.

Common Rules

Codes

Every upload returns an uppercase 8-character code. Use that code with metadata, download, and QR endpoints.

Expiration

If no expiration is sent, public uploads are retained for up to 30 days. Public users cannot set never-expire shares.

One-time Shares

Set oneTime to 1, true, yes, or on. One-time shares are consumed after one successful download or redirect.

Endpoints

GET /api/auth/status

Returns whether the caller is logged in and the upload policy that applies to the request.

curl https://cds.unidrac.com/api/auth/status
{
  "loggedIn": false,
  "loginUrl": "https://auth.unidrac.com/login?next=...",
  "uploadPolicy": {
    "limitBytes": 262144000,
    "canStaticUpload": false,
    "canLargeFileSize": false
  }
}
POST /api/upload

Uploads one file using multipart/form-data.

Field Type Required Description
file file Yes File content to share.
oneTime boolean string No Consumes the share after one successful download.
expireDays integer No 0 to 30 days.
expireHours integer No 0 to 23 hours.
curl -F "file=@report.pdf" \
  -F "oneTime=1" \
  -F "expireDays=7" \
  https://cds.unidrac.com/api/upload
POST /api/upload-stream

Uploads raw request-body bytes. Send the file name in name or X-File-Name.

curl --data-binary "@archive.zip" \
  "https://cds.unidrac.com/api/upload-stream?name=archive.zip&oneTime=0&expireDays=3"
POST /api/upload-note

Creates a shared HTML note and returns a download code.

curl -H "Content-Type: application/json" \
  -d '{"title":"Read me","html":"<p>Hello</p>","oneTime":"0","expireDays":"1"}' \
  https://cds.unidrac.com/api/upload-note
POST /api/upload-link

Creates a short code that redirects to a public http or https URL.

curl -H "Content-Type: application/json" \
  -d '{"url":"https://example.com/file","oneTime":"1","expireHours":"12"}' \
  https://cds.unidrac.com/api/upload-link
GET /api/file/{code}

Returns metadata for an active code.

curl https://cds.unidrac.com/api/file/ABCDEFG1
{
  "code": "ABCDEFG1",
  "fileName": "report.pdf",
  "size": 12345,
  "oneTime": true,
  "expiresAt": "2026-05-29T08:00:00.000Z",
  "neverExpires": false,
  "successfulDownloads": 0,
  "available": true
}
GET /api/download/{code}

Downloads the file, displays a note inline, or redirects to a stored link.

curl -L -o shared-file https://cds.unidrac.com/api/download/ABCDEFG1
GET /dl/{code}

Short public download URL. Upload responses use this format in downloadUrl.

https://cds.unidrac.com/dl/ABCDEFG1
GET /api/qr/{code}

Returns an SVG QR code for the public download URL.

curl https://cds.unidrac.com/api/qr/ABCDEFG1 -o qr.svg

Upload Response

Upload, note, and link creation endpoints return the same response shape.

{
  "code": "ABCDEFG1",
  "fileName": "report.pdf",
  "oneTime": true,
  "expiresAt": "2026-05-29T08:00:00.000Z",
  "neverExpires": false,
  "downloadUrl": "https://cds.unidrac.com/dl/ABCDEFG1"
}

Errors

Status Meaning
400 Invalid code, URL, upload fields, or expiration settings.
404 Code or file was not found.
410 Code has expired or a one-time share was already consumed.
413 Upload is larger than the caller's allowed limit.
500 Server-side upload, download, QR, or storage failure.

Management and personal file endpoints under /api/manage/ and /api/user/ require login or elevated permissions and are not part of the public API.