Skip to main content
Learn how to upload media to the OnlyFans vault so you can use it in posts and messages.

Prerequisites

You have a connected OnlyFans account with a valid connectionId

Upload Flow Overview

Uploading media is a multi-step process:

Step 1: Initialize Upload

Tell OFAuth about the file you want to upload:
Request body: Example response:
Response fields:
The response also includes x-ofauth-upload-total-parts and x-ofauth-upload-part-size headers for backward compatibility. Prefer the response body for new integrations.

Step 2: Upload the File

Single-Part Upload (Small Files)

For files that fit in one part (upload.uploadType is "single"), upload the whole file to the first uploadUrl:
Single-part PUT response:

Multi-Part Upload (Large Files)

For larger files, upload each parts[] entry. Slice the file using the provided byteRange, then send that chunk to the entry’s uploadUrl:
Multipart part PUT response:

Step 3: Complete Upload (Multi-Part Only)

For multi-part uploads, call completeUrl after all chunks are uploaded:
Request body:
Response body:
Use the returned mediaUploadId in a post or message:
Single-part uploads auto-complete. When uploadType is "single", the PUT response returns the media directly. Do not call /complete.

Minimal JavaScript Multipart Example


Supported Formats

Check OnlyFans’ current guidelines for exact size limits, as they may change.

Using Uploaded Media

Once uploaded, use the media in posts or messages.

Use Upload Reference Directly

Pass the mediaUploadId string directly to mediaItems - the system resolves it automatically:
Upload references are automatically resolved to vault media IDs by the API. This is the simplest approach.

Use Vault Media ID

If your upload workflow returns media, you can use the numeric vault media ID instead:

What mediaItems Accepts

See the mediaItems reference.
Single-use: Upload references are consumed when used. Once you include a mediaUploadId in a post or message, it cannot be reused. If you need to use the same media multiple times, store the vault media ID instead.

Check for Existing Uploaded Media

Use /uploads/check to see if media with a known upload ETag and size already exists in the vault:
Request body: Response body:

Error Handling


Tips & Best Practices

Retry failed chunks: If a chunk upload fails, you can retry just that chunk without restarting the entire upload.
Upload to vault first for reuse: Vault uploads give you a media ID or upload reference that you can attach to posts and messages.
Session timeout: Upload sessions expire after a period of inactivity. Start the complete flow and finish promptly.

Next Steps

Create a Post

Use uploaded media in posts

Send a Message

Send media in direct messages