OkFile provides an agent-first upload and publish flow for files and static sites, with direct links, preview URLs, parallel uploads, and a retained manual upload entry when you need it.
Built for agent workflows, scripted publishing, and tool-driven delivery without manual browser steps.
Single-file and multi-file publishing both stay fast and return shareable links quickly.
Upload a full static site folder and publish it to a dedicated subdomain with nested paths preserved.
Supports parallel multi-file uploads and multipart chunking for large files up to 500MB.
Use anonymous publishing for quick tasks or API Keys for higher quotas and account-based control.
The same publish result can return both the direct file URL and a preview or playback URL.
Recommended for automation, integrations, and repeated publish workflows.
Agents can directly upload files, publish static site folders, run parallel uploads, and return either direct file links or site URLs from the same workflow.
Publish File
1. POST /api/upload/prepare
2. PUT to uploadUrl or each parts[].uploadUrl
3. POST /api/upload/complete
Publish Site
1. POST /api/site/prepare
2. Upload each site file and collect fileId values
3. POST /api/site/complete
4. Return siteUrl and entryUrl
Minimal endpoints for file publishing, status queries, and static site publishing.
curl -X POST "https://www.okfile.com/api/upload/prepare" \
-H "Content-Type: application/json" \
--data '{"filename":"photo.jpg","size":12345,"contentType":"image/jpeg","preferredPartSize":5242880}'
curl -X POST "https://www.okfile.com/api/upload/complete" \
-H "Content-Type: application/json" \
--data '{"id":"a3k7m92x"}'
curl "https://www.okfile.com/api/upload/status/a3k7m92x"
curl -X POST "https://www.okfile.com/api/site/prepare" \
-H "Content-Type: application/json" \
--data '{"siteName":"docs-site","files":[{"path":"docs/getting-started.md","size":1200,"contentType":"text/markdown; charset=utf-8"},{"path":"assets/app.css","size":3200,"contentType":"text/css; charset=utf-8"}]}'
curl -X POST "https://www.okfile.com/api/site/complete" \
-H "Content-Type: application/json" \
--data '{"siteId":"st_xxxx","siteToken":"token_xxxx","files":[{"relativePath":"docs/getting-started.md","fileId":"a3k7m92x"},{"relativePath":"assets/app.css","fileId":"b8f2k19a"}]}'
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/upload/prepare | Request a single-upload or multipart upload URL and receive the future public file URLs. |
| PUT | uploadUrl / parts[].uploadUrl | Upload the file body or each file part directly. |
| POST | /api/upload/complete | Finalize the upload using the returned file id. |
| GET | /api/upload/status/{id} | Query multipart upload progress and status. |
| POST | /api/site/prepare | Create a publish session for a static site folder. |
| POST | /api/site/complete | Finalize static site publishing and receive the site URLs. |
| GET | /i/{id} | Direct file URL. |
| GET | /i/{id}?play=1 | Preview or playback page for images, videos, and PDFs. |