Skip to content

API Docs

Base URL: https://putput-ala.pages.dev/api/v1 · Every endpoint below is live — hit "run" and see real responses.

Getting your guest token...

POST /api/v1/auth/guest

No auth required. No request body. Returns a fresh guest token with storage limits.

AuthBodyRate limit
NoneNone5 per IP per day
POST /api/v1/upload/presign

Requires auth. Sends file metadata, gets back a presigned URL for direct upload to R2.

FieldTypeValue sent
filenamestring"api-docs-test.txt"
content_typestring"text/plain"
size_bytesnumber20
  • Presigned URL expires in 1 hour
  • Rate limit: 100 per token per hour
  • Errors: VALIDATION_ERROR 400, FILE_TOO_LARGE 413, STORAGE_LIMIT_EXCEEDED 403, CONTENT_TYPE_BLOCKED 403

Click run for just the presign step, or run full flow to presign → upload → confirm in one go and get a live CDN URL.

GET /api/v1/files

Requires auth. Returns your uploaded files with cursor pagination.

ParamTypeDefaultDescription
cursorstring(none)Opaque cursor from previous response
limitnumber50Items per page (max 100)
DELETE /api/v1/files/:id

Requires auth. Permanently removes a file from storage.

Run GET /files first to load your files, then pick one to delete.

File object

Every endpoint that returns file data uses this shape:

typescript
interface File {
  id: string;            // "file_xyz"
  original_name: string; // "photo.jpg"
  public_name: string;   // "abc123/photo.jpg"
  public_url: string;    // full CDN URL
  content_type: string;  // "image/jpeg"
  size_bytes: number;    // file size in bytes
  created_at: string;    // ISO 8601 timestamp
}

Error codes

All errors return:

json
{ "error": { "code": "SCREAMING_SNAKE", "message": "...", "hint": "..." } }
CodeHTTPWhen
UNAUTHORIZED401Missing or invalid Bearer token
FORBIDDEN403IP banned or action not permitted
VALIDATION_ERROR400Invalid request body
UPLOAD_NOT_FOUND404Invalid, expired, or already-confirmed upload_id
FILE_NOT_FOUND404File doesn't exist or already deleted
FILE_NOT_UPLOADED400Confirm called before PUT completed
FILE_TOO_LARGE413Exceeds max file size for plan
FILE_LIMIT_EXCEEDED403File count limit reached
STORAGE_LIMIT_EXCEEDED403Storage quota exceeded
CONTENT_TYPE_BLOCKED403MIME type not allowed for guest tokens
RATE_LIMITED429Too many requests
SERVER_ERROR500Internal server error

Rate limits

EndpointLimitWindowKey
POST /auth/guest5per dayper IP
POST /upload/presign100per hourper token

More resources

v0.4.77