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

# Upload File

> Upload a media file using multipart form data.

Upload a media file by multipart form. Returns an `id` and `path` you can pass into a post's `image` array.

## Accepted MIME types

The backend inspects the file's actual content (not just the extension) and rejects anything outside this allowlist:

| Type      | MIME         |
| --------- | ------------ |
| JPEG      | `image/jpeg` |
| PNG       | `image/png`  |
| GIF       | `image/gif`  |
| WebP      | `image/webp` |
| AVIF      | `image/avif` |
| BMP       | `image/bmp`  |
| TIFF      | `image/tiff` |
| MP4 video | `video/mp4`  |

PDFs are not accepted. See [Uploads troubleshooting](/troubleshooting/uploads) for limits and recommended video formats.

## Example

```bash theme={null}
curl -X POST "https://api.postiz.com/public/v1/upload" \
  -H "Authorization: your-api-key" \
  -F "file=@photo.jpg"
```

Example response:

```json theme={null}
{
  "id": "01HXYZ123ABCDEF",
  "path": "https://uploads.postiz.com/photo.jpg"
}
```

## Usage in a post

```json theme={null}
{
  "image": [
    {
      "id": "01HXYZ123ABCDEF",
      "path": "https://uploads.postiz.com/photo.jpg"
    }
  ]
}
```


## OpenAPI

````yaml POST /upload
openapi: 3.1.0
info:
  title: Postiz Public API
  description: >-
    API for managing social media posts, integrations, and media uploads in
    Postiz.


    ## Authentication


    All endpoints require an API key passed in the `Authorization` header:


    ```

    Authorization: your-api-key

    ```


    Get your API key from Postiz Settings.


    ## Rate Limits


    There is a limit of **30 requests per hour**.


    ## Terminology


    The UI uses `channel`, but the API uses `integration`. They refer to the
    same thing.


    ## Supported Platforms (27)


    **Social Platforms:** X (Twitter), LinkedIn, LinkedIn Page, Facebook,
    Instagram, Instagram Standalone, Threads, Bluesky, Mastodon, Warpcast
    (Farcaster), Nostr, VK


    **Video Platforms:** YouTube, TikTok


    **Community Platforms:** Reddit, Lemmy, Discord, Slack, Telegram


    **Design Platforms:** Pinterest, Dribbble


    **Blogging Platforms:** Medium, Dev.to, Hashnode, WordPress


    **Business:** Google My Business (GMB), Listmonk (newsletters)
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.postiz.com/public/v1
    description: Postiz Cloud
  - url: https://{your-domain}/api/public/v1
    description: Self-hosted
    variables:
      your-domain:
        default: localhost:5000
        description: Your Postiz instance domain
security:
  - ApiKeyAuth: []
tags:
  - name: Integrations
    description: Manage connected social media channels
  - name: Posts
    description: Create, list, and delete posts
  - name: Uploads
    description: Upload media files
  - name: Notifications
    description: View organization notifications
  - name: Analytics
    description: View analytics for integrations and posts
  - name: Video Generation
    description: Generate videos with AI
paths:
  /upload:
    post:
      tags:
        - Uploads
      summary: Upload a file
      description: Upload a media file using multipart form data.
      operationId: uploadFile
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The file to upload
              required:
                - file
      responses:
        '200':
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaFile'
components:
  schemas:
    MediaFile:
      type: object
      properties:
        id:
          type: string
          description: Unique file ID
        name:
          type: string
          description: File name
        path:
          type: string
          description: File URL
        organizationId:
          type: string
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      example:
        id: e639003b-f727-4a1e-87bd-74a2c48ae41e
        name: image.png
        path: https://uploads.postiz.com/image.png
        organizationId: 85460a39-6329-4cf4-a252-187ce89a3480
        createdAt: '2024-12-14T08:18:54.274Z'
        updatedAt: '2024-12-14T08:18:54.274Z'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Your Postiz API key

````