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

# Request a media upload URL

> Returns a presigned upload URL for direct upload to storage, or fetches a file
from the provided source URL. Supports images and videos.



## OpenAPI

````yaml api-reference/openapi.json post /media
openapi: 3.1.0
info:
  title: Tibbie
  version: '1.0'
  description: REST API for managing posts and connections on Tibbie.
servers:
  - url: https://tibbie.co/api/v1
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: User
  - name: Connections
  - name: Posts
  - name: Media
paths:
  /media:
    post:
      tags:
        - Media
      summary: Request a media upload URL
      description: >-
        Returns a presigned upload URL for direct upload to storage, or fetches
        a file

        from the provided source URL. Supports images and videos.
      operationId: media.store
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                mime_type:
                  type: string
                  enum:
                    - image/jpeg
                    - image/png
                    - image/gif
                    - image/webp
                    - video/mp4
                    - video/quicktime
                filename:
                  type:
                    - string
                    - 'null'
                  maxLength: 255
                source_url:
                  type:
                    - string
                    - 'null'
                  format: uri
                  maxLength: 2048
              required:
                - mime_type
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                anyOf:
                  - type: object
                    properties:
                      upload_url:
                        type: string
                      upload_headers:
                        type: string
                      path:
                        type: string
                      expires_in:
                        type: string
                    required:
                      - upload_url
                      - upload_headers
                      - path
                      - expires_in
                  - type: object
                    properties:
                      path:
                        type: string
                      url:
                        type: string
                      mime_type:
                        type: string
                      size:
                        type: integer
                    required:
                      - path
                      - url
                      - mime_type
                      - size
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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