Make your first request
All REST endpoints are versioned under the base URL below. JSON endpoints expect a bearer credential and return JSON unless the endpoint streams file contents.
curl "https://www.useanyfile.com/api/v1/files?limit=25" \
-H "Authorization: Bearer YOUR_API_KEY"Keep API keys secret. AnyFile only shows a newly created key once, so store it securely when you create it.
API keys and OAuth 2.0
Send either an AnyFile API key or an OAuth 2.0 access token in the Authorization header. OAuth tokens for REST integrations target the AnyFile API resource.
Authorization: Bearer YOUR_API_KEYOAuth authorization-server metadata is available at /.well-known/oauth-authorization-server.
Use least-privilege scopes
API keys and OAuth use the same granular permissions. Grant only the scopes your integration needs. Uploading, organizing, renaming, and deleting owned files or folders requires files:write. Reading folders and downloads use files:read. Moving a file request requires requests:write.
files:readView your files, including their contents and metadatafiles:writeUpload, rename, and delete your filesfolders:readView your folders and their resource countsfolders:writeCreate, rename, and delete your foldersshares:readView your share linksshares:writeCreate, update, and disable share linksrequests:readView your file requests and submissionsrequests:writeCreate, update, and disable file requestsanalytics:readView share analyticsUpload directly without proxying file bytes
AnyFile uses short-lived upload grants so large files transfer directly to private Blob storage. First prepare one or many uploads with file metadata. Add an owned folder ID to create the resulting files directly inside that folder.
POST https://www.useanyfile.com/api/v1/files
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"folderId": "FOLDER_ID",
"files": [
{
"name": "proposal.pdf",
"type": "application/pdf",
"size": 482193
}
]
}Install @vercel/blob, then transfer each file using the returned pathname, handleUploadUrl, and clientPayload. Pass the client payload exactly as returned. It expires with the upload intent and should be treated like a presigned upload URL.
import { upload } from "@vercel/blob/client";
await upload(grant.pathname, file, {
access: "private",
contentType: grant.contentType,
multipart: file.size > 5 * 1024 * 1024,
handleUploadUrl: grant.handleUploadUrl,
clientPayload: JSON.stringify(grant.clientPayload),
});Finally, poll the returned statusUrl with the same bearer credential used to prepare the upload until the status iscomplete. The result contains the AnyFile file ID you can use with download, metadata, deletion, folder moves, or the existing share-link endpoint.
GET https://www.useanyfile.com/api/v1/files/uploads/UPLOAD_INTENT_ID
Authorization: Bearer YOUR_API_KEY
{
"data": {
"status": "complete",
"result": { "id": "FILE_ID" }
}
}Organize files and request destinations
Folders are flat, user-owned containers. Files and file requests expose both folderId and compact folder metadata. Filter collection endpoints with folderId, or setfolderId: null on an update to move a resource back to root. Deleting a folder keeps its contents and moves them to root automatically.
POST https://www.useanyfile.com/api/v1/folders
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{ "name": "Client A" }PATCH https://www.useanyfile.com/api/v1/files/FILE_ID
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{ "folderId": "FOLDER_ID" }POST https://www.useanyfile.com/api/v1/requests
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
"title": "Upload your documents",
"folderId": "FOLDER_ID"
}Cursor-based pagination
Collection endpoints use cursor pagination. Pass the returnednextCursorvalue as the next request'scursorparameter. A null next cursor means there are no more results.
{
"data": [...],
"pagination": {
"nextCursor": "cursor_value"
}
}Structured error responses
API errors use a consistent object with a machine-readable code, human-readable message, and actionable hint. Handle 400, 401, 403, 404, 409, and 429 responses where applicable.
{
"error": {
"code": "...",
"message": "...",
"hint": "..."
}
}Endpoints
The reference below summarizes the public v1 surface. Use the OpenAPI contract for complete request, response, and schema definitions.
/PublicAPI capabilities
Inspect the public API capability index. Authentication is not required.
/filesfiles:readList files
List owned file metadata with search, folder filtering, cursor pagination, and a configurable limit.
/filesfiles:writePrepare file uploads
Prepare one or many direct uploads, optionally into a folder, and receive short-lived Blob upload grants.
/filesfiles:writeDelete files
Permanently delete one or many owned files by file ID.
/files/uploads/{intentId}files:writeGet upload status
Poll a prepared upload until it returns the created AnyFile file ID or an error.
/files/{fileId}files:readGet a file
Get metadata for one file, including its folder assignment.
/files/{fileId}files:writeUpdate file metadata
Rename and/or move an owned file. Use folderId: null to move it back to root.
/files/{fileId}files:writeDelete a file
Permanently delete one owned file and its generated previews.
/files/{fileId}/downloadfiles:readDownload a file
Stream an owned file through the authenticated AnyFile download endpoint.
/foldersfiles:readList folders
List owned folders with file and file-request counts.
/foldersfiles:writeCreate a folder
Create a flat user-owned folder for files and file requests.
/folders/{folderId}files:readGet a folder
Get one owned folder and its resource counts.
/folders/{folderId}files:writeRename a folder
Rename an owned folder.
/folders/{folderId}files:writeDelete a folder
Delete a folder without deleting its contents. Files and file requests move back to root.
/sharesshares:readList share links
List share links with cursor pagination.
/sharesshares:writeCreate a share link
Create or reactivate a share link for an owned file.
/shares/{shareId}shares:readGet a share link
Get one share link and its associated file metadata.
/shares/{shareId}shares:writeUpdate a share link
Update the state or supported settings of an existing share link.
/requestsrequests:readList file requests
List file requests with cursor pagination and optional folderId filtering.
/requestsrequests:writeCreate a file request
Create a file request, optionally assign a destination folder, and return its public URL.
/requests/{requestId}requests:readGet a file request
Get one file request, its folder assignment, and its submission count.
/requests/{requestId}requests:writeUpdate a file request
Update settings and/or move a file request. Use folderId: null to move it back to root.
/requests/{requestId}/submissionsrequests:readList request submissions
Review submitter details and safe file metadata without exposing private storage URLs.
/analyticsanalytics:readGet analytics
Read aggregate analytics, or pass shareId to inspect one owned share.
Need machine-readable docs?
The OpenAPI 3.1 document is available directly for client generation, tooling, and agent discovery.
View /openapi.json