OnlyFans API
FanslyMedia

Upload Media

Upload a file to Fansly and receive a reusable fansly_media_ ID that can be attached to chat messages (and, later, posts). Provide either file or file_url. Credits are charged per megabyte uploaded.

POST
/api/fansly/{fanslyAccount}/media/upload
AuthorizationBearer <token>

Get your API Key from OnlyFansAPI Console - https://app.onlyfansapi.com/api-keys

In: header

Path Parameters

fanslyAccount*string

The Fansly Account ID

Request Body

multipart/form-data

file?string

The file to upload. Required if file_url is not provided. Maximum file size: 100 MB.

file_url?string

A URL to download the file from. Required if file is not provided.

async?boolean

Set to true to process the upload in the background. Returns a polling_url to check status. Recommended for large files/videos.

Response Body

application/json

application/json

curl -X POST "https://app.onlyfansapi.com/api/fansly/fansly_acct_XXXXXXXXXXXXXXX/media/upload"
{
  "prefixed_id": "fansly_media_01JR1234ABCD5678EFGH",
  "file_name": "photo.jpg",
  "media_id": "800000000000000010",
  "media": {
    "id": "800000000000000010",
    "type": 1,
    "status": 1,
    "accountId": "800000000000000001",
    "mimetype": "image/jpeg",
    "filename": "photo.jpg",
    "width": 1080,
    "height": 1080
  },
  "credits_used": 1
}
{
  "status": "pending",
  "prefixed_id": "fansly_media_01JR1234ABCD5678EFGH",
  "polling_url": "https://app.onlyfansapi.com/api/fansly/fansly_acct_XXXXXXXXXXXXXXX/media/uploads/fansly_media_01JR1234ABCD5678EFGH/status"
}