Server API
Manage application files from trusted server code.
Create a server client
UTApi remains the compatibility class name in the fork. Create one scoped credential per integration and rotate it without sharing your dashboard identity.
import { UTApi } from "uploadfile/server";
// Reads UPLOADFILE_TOKEN and UPLOADFILE_API_URL on the server.
const files = new UTApi();
const page = await files.listFiles({ limit: 25 });
const deleted = await files.deleteFiles(["file-key"]);Common operations
- List and inspect uploaded files with pagination.
- Upload server-side files or import authorized URLs.
- Rename files and attach application-unique custom IDs.
- Change public/private access and generate signed delivery URLs.
- Delete files permanently, including cleanup when normal use is blocked.
Treat arbitrary URL import as a server-side request risk. The service must validate destinations, redirects, and network ranges; do not assume a URL is safe because a user submitted it.
Keys and errors
API keys are bound to an application and an explicit set of scopes. They cannot manage organization membership, identity, or billing. The dashboard reveals a new key once; lost secrets must be replaced.
Handle authorization failures, quota limits, conflicts, and transient errors separately. Retrying an already completed logical operation should use its idempotency identity. Do not blindly retry irreversible actions with a fresh identity.
Uploadfile is an independently operated service. The framework SDK is forked from the MIT-licensed UploadThing SDK; UploadThing’s hosted backend is not included in that source.