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

# Upload media

> Upload an image (JPEG, PNG, WebP, or GIF, up to 10MB) and get an `id` to attach to a post via `media`. Send as `multipart/form-data` with a `file` field.



## OpenAPI

````yaml /openapi.json post /media
openapi: 3.1.0
info:
  title: Market or Die API
  version: 1.0.0
  description: >-
    Compose, schedule, and ship posts to every connected channel —
    programmatically.
servers:
  - url: https://api.marketordie.io/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Who the API key acts as.
  - name: Channels
    description: Connected accounts you can post to.
  - name: Media
    description: Upload images to attach to posts.
  - name: Posts
    description: Create, schedule, list, and delete posts.
  - name: Leaderboard
    description: Team standings by points.
paths:
  /media:
    post:
      tags:
        - Media
      summary: Upload media
      description: >-
        Upload an image (JPEG, PNG, WebP, or GIF, up to 10MB) and get an `id` to
        attach to a post via `media`. Send as `multipart/form-data` with a
        `file` field.
      operationId: uploadMedia
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                  description: The image file.
      responses:
        '201':
          description: Uploaded
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Pass this in a post's `media` array.
                      type:
                        type: string
                        enum:
                          - image
                      url:
                        type: string
                        format: uri
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  responses:
    BadRequest:
      description: Invalid request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: invalid_request
              message: Provide `text` or a non-empty `thread`.
    Unauthorized:
      description: Missing or invalid API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
              message: Invalid or revoked API key.
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your API key as a bearer token: `Authorization: Bearer mod_live_…`. (You
        can also send it as `x-api-key`.)

````