OnlyFans Media Upload API
The onlyfans media upload api pushes a photo or video into a creator's OnlyFans vault and hands back a stable mediaId. That id is the currency of every content action in ofapis: attach it to a DM, a scheduled post, a mass mailing, or use it as a PPV preview. Upload the bytes once, reference them everywhere — you never re-transfer the file.
Endpoint
POST /api/public/v1/accounts/{accountId}/media
Uploads are always account-scoped: you tell ofapis which linked account owns the file. Send it as multipart/form-data under the field name file — curl sets the boundary for you, so no explicit Content-Type header is needed.
Upload a file
curl -X POST \
https://api.ofapis.com/api/public/v1/accounts/42/media \
-H "Authorization: Bearer ofapis_sk_..." \
-F "[email protected]"
A successful upload debits one credit and returns the reference:
{ "data": { "mediaId": 987654321, "contentType": "video/mp4", "filename": "promo.mp4" } }
Accepted formats and limits
| Constraint | Value |
|---|---|
| Max file size | 50 MB |
| Image types | image/jpeg, image/png, image/webp |
| Video types | video/mp4 |
Exceed the size cap and the call fails with MEDIA_FILE_TOO_LARGE — a failed call, so it isn't charged.
Attaching the media id
The returned mediaId drops straight into other request bodies:
- DMs — pass it in
mediaFileswhen you send a message. - Scheduled posts — attach it when you schedule a post.
- PPV — list it under
previewsto show a locked-media thumbnail (see the PPV API).
Use cases
- Batch prep. Upload the week's assets in one pass, store each
mediaId, then feed them to the scheduler so every post goes out with the right file — no manual re-upload per post. - Chatter tooling. Let a chatter drop a file in your own UI; you upload it and immediately attach the id to the open conversation.
- PPV libraries. Keep a catalog of vault ids and reference sets by id from message flows without ever touching the bytes again.
Gotchas
- Uploads are slow. Video transfers take real time, and OnlyFans still has to process the file after the response. Use generous client timeouts; media may be usable a moment later, not always instantly. Check
isMediaReadyon a message before relying on it. - Billing. One successful upload is one credit. A rejected file (too large, wrong type, expired session) is free.
- Rate limits follow your plan's requests-per-minute — upload batches sequentially rather than firing them all in parallel. See pricing.
- Vault is per-account. A file uploaded under account
42lives in that creator's vault only; there is no shared cross-account pool.
FAQ
What file types and sizes can I upload?
JPEG, PNG, and WebP images plus MP4 video, up to 50 MB per file. Anything larger returns MEDIA_FILE_TOO_LARGE and isn't charged.
Do I need the account id to upload?
Yes. The route is POST /accounts/{accountId}/media and always targets one linked account's vault explicitly — there is no global upload.
Can I reuse one upload across many messages and posts?
Yes. Upload once, keep the returned mediaId, and attach it to any number of messages, posts, or mailings without re-sending the bytes.
Why is my attached media not showing yet?
OnlyFans processes media after upload. Poll the message's isMediaReady flag and wait for it to flip true before treating the attachment as live.