Media

Upload media to the OnlyFans CDN

Changed on

The response can be used only once to manually include media in a post or message. This endpoint does not upload media to the Vault. You must provide either file or file_url.

post/api/{account}/media/upload

Request

  • Base URL
    https://app.onlyfansapi.com
  • URL
    https://app.onlyfansapi.com/api/{account}/media/upload
  • Auth
    HTTP bearer

Request body multipart/form-data

filestring binary

The file to upload. Required if file_url is not provided. Maximum file size: 100 MB (limited by Cloudflare).

file_urlstring

A URL to download the file from. Required if file is not provided. Maximum file size depends on the subscription configuration.

asyncboolean

Set to true to process uploads in the background. Returns a polling_url to check status. Recommended for large files. Instead of polling, you can subscribe to the media_uploads.completed and media_uploads.failed webhook events — they only fire for async uploads.

type'default' | 'avatar' | 'header'

Set to avatar if this file will be used as a profile picture, header for a profile banner, or keep empty if this file will be for anything else.

Example request

{
  "file_url": "https://example.com/media/photo.jpg",
  "async": true,
  "type": "avatar"
}

Response

Synchronous upload (default)

prefixed_idstring
file_namestring
processIdstring
hoststring
sourceUrlstring
extrastring
notestring

Example response

{
  "prefixed_id": "ofapi_media_abc123def456abc123def456abc123de",
  "file_name": "photo.jpg",
  "processId": "abc123def456abc123de",
  "host": "convert3.onlyfans.com",
  "sourceUrl": "https://of2transcoder.s3.amazonaws.com/upload/00000000-0000-0000-0000-000000000000/000000000000/photo.jpg",
  "extra": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...",
  "additional": {
    "user": "123456789"
  },
  "thumbs": [
    {
      "id": 1,
      "url": "https://cdn2.onlyfans.com/files/0/00/00000000000000000000000000000000/300x544_00000000000000000000000000000000.jpg"
    }
  ],
  "note": "Maximum file size is 1 GB. Need higher limits? Contact us for enterprise options."
}

Changes

    • breaking

      removed the media type application/json from the request body

    • info

      request body became optional

    • info

      added the media type multipart/form-data to the request body

    • info

      added the optional property to the response with the status

    • info

      added the success response with the status