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

# Upload a file

> Uploads an image, GIF or video in one request. For large files use the chunked upload.

**Required permission:** `publishing:media:write`



## OpenAPI

````yaml /api-reference/publishing.openapi.json post /{workspace}/media
openapi: 3.1.0
info:
  title: Publishing API
  version: 1.0.0
  description: >-
    Social accounts, posts, scheduling, approval, tags and media for one
    workspace.
servers:
  - url: https://{domain}/os/api
    description: Your platform domain
    variables:
      domain:
        default: app.example.com
        description: The domain you sign in to, without https://
security:
  - bearerAuth: []
  - apiKeyHeader: []
tags:
  - name: Diagnostics
  - name: Accounts
  - name: Posts
  - name: Media
  - name: Tags
paths:
  /{workspace}/media:
    post:
      tags:
        - Media
      summary: Upload a file
      description: >-
        Uploads an image, GIF or video in one request. For large files use the
        chunked upload.


        **Required permission:** `publishing:media:write`
      operationId: media.upload
      parameters:
        - name: workspace
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: Your workspace UUID. Must match the API key's workspace.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - file
              properties:
                file:
                  type: string
                  format: binary
                alt_text:
                  type: string
                  maxLength: 255
      responses:
        '201':
          description: Uploaded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Media'
components:
  schemas:
    Media:
      type: object
      properties:
        id:
          type: integer
          description: Use this in a post version's `media`.
        uuid:
          type: string
          format: uuid
        name:
          type: string
        mime_type:
          type: string
        type:
          type: string
        url:
          type: string
        thumb_url:
          type: string
        is_video:
          type: boolean
        created_at:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'A workspace API key: `Authorization: Bearer osk_...`'
    apiKeyHeader:
      type: apiKey
      in: header
      name: x-api-key
      description: The same workspace API key in the `x-api-key` header.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.