> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onlyfansapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload Media (/api-reference/fansly/media/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.

## OpenAPI

````yaml https://app.onlyfansapi.com/scribe-fansly-docs/openapi.yaml post /api/fansly/{fanslyAccount}/media/upload
openapi: 3.0.3
info:
  title: Fansly API Documentation
  description: ""
  version: 1.0.0
servers:
  - url: https://app.onlyfansapi.com
security:
  - default: []
tags:
  - name: Account
    description: Endpoints for your linked Fansly accounts
  - name: Chats
    description: Endpoints for Fansly chats (messaging groups)
  - name: Connect Fansly Account
    description: ""
  - name: Earnings
    description: Endpoints for Fansly Earnings — wallets, balances, transactions,
      payouts, and statements.
  - name: Followers
    description: Endpoints for Fansly followers.
  - name: Lists
    description: Endpoints for Fansly subscriber/fan lists (e.g. "VIP", "Spenders").
  - name: Media
    description: Upload media for use in Fansly posts and messages
  - name: Profile Statistics
    description: Endpoints for Fansly Profile Statistics (viewer engagement insights).
  - name: Subscribers
    description: Endpoints for Fansly subscribers and subscription tiers.
  - name: Top Supporters
    description: Endpoints for the Fansly "Top Supporters" view — see who spends the
      most and what they spend on.
  - name: Tracking Links
    description: Endpoints for Fansly tracking links — per-source attribution links
      (e.g. "Twitter bio", "FYP", "Search").
  - name: Users
    description: APIs for fetching Fansly users
paths:
  /api/fansly/{fanslyAccount}/media/upload:
    parameters:
      - in: path
        name: fanslyAccount
        description: The Fansly Account ID
        example: fansly_acct_XXXXXXXXXXXXXXX
        required: true
        schema:
          type: string
    post:
      summary: Upload Media
      operationId: uploadMedia
      description: 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.
      parameters: []
      responses:
        "200":
          description: Synchronous upload (default)
          content:
            application/json:
              schema:
                type: object
                example:
                  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
                properties:
                  prefixed_id:
                    type: string
                    example: fansly_media_01JR1234ABCD5678EFGH
                  file_name:
                    type: string
                    example: photo.jpg
                  media_id:
                    type: string
                    example: "800000000000000010"
                  media:
                    type: object
                    properties:
                      id:
                        type: string
                        example: "800000000000000010"
                      type:
                        type: integer
                        example: 1
                      status:
                        type: integer
                        example: 1
                      accountId:
                        type: string
                        example: "800000000000000001"
                      mimetype:
                        type: string
                        example: image/jpeg
                      filename:
                        type: string
                        example: photo.jpg
                      width:
                        type: integer
                        example: 1080
                      height:
                        type: integer
                        example: 1080
                  credits_used:
                    type: integer
                    example: 1
        "202":
          description: Async upload (async=true)
          content:
            application/json:
              schema:
                type: object
                example:
                  status: pending
                  prefixed_id: fansly_media_01JR1234ABCD5678EFGH
                  polling_url: https://app.onlyfansapi.com/api/fansly/fansly_acct_XXXXXXXXXXXXXXX/media/uploads/fansly_media_01JR1234ABCD5678EFGH/status
                properties:
                  status:
                    type: string
                    example: pending
                  prefixed_id:
                    type: string
                    example: fansly_media_01JR1234ABCD5678EFGH
                  polling_url:
                    type: string
                    example: https://app.onlyfansapi.com/api/fansly/fansly_acct_XXXXXXXXXXXXXXX/media/uploads/fansly_media_01JR1234ABCD5678EFGH/status
      tags:
        - Media
      requestBody:
        required: false
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: "The file to upload. Required if `file_url` is not provided.
                    Maximum file size: 100 MB."
                file_url:
                  type: string
                  description: A URL to download the file from. Required if `file` is not
                    provided.
                  example: https://example.com/media/photo.jpg
                async:
                  type: boolean
                  description: Set to `true` to process the upload in the background. Returns a
                    `polling_url` to check status. Recommended for large
                    files/videos.
                  example: true
components:
  securitySchemes:
    default:
      type: http
      scheme: bearer
      description: Get your API Key from OnlyFansAPI Console -
        https://app.onlyfansapi.com/api-keys
````