ofapisv1
capability

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:

Use cases

Gotchas

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.

Get a free token · Vault & Media API · API reference

Related guides

All guides
Start free — 250 credits, no card
Generate a token and make your first call in minutes.
Get started