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

# Issue pre-signed direct-to-storage upload URLs



## OpenAPI

````yaml /openapi.json post /workspaces/{workspace}/media_contents/presign
openapi: 3.1.0
info:
  title: PublishBuddy
  version: 0.0.1
servers:
  - url: https://api.publishbuddy.com/v1
security: []
paths:
  /workspaces/{workspace}/media_contents/presign:
    post:
      tags:
        - MediaContent
      summary: Issue pre-signed direct-to-storage upload URLs
      operationId: mediaContent.presign
      parameters:
        - name: workspace
          in: path
          required: true
          description: The workspace UUID
          schema:
            type: string
        - name: Authorization
          in: header
          required: true
          description: JWT token.
          schema:
            type: string
          example: Bearer 123
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PresignMediaContentRequest'
      responses:
        '200':
          description: Array of `PresignedMediaUploadResource`
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PresignedMediaUploadResource'
                required:
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          $ref: '#/components/responses/ModelNotFoundException'
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    PresignMediaContentRequest:
      type: object
      properties:
        files:
          type: array
          description: Files to upload (1–10 items per request)
          items:
            type: object
            properties:
              name:
                type: string
                description: Original filename including extension (e.g. `photo.jpg`)
                maxLength: 255
              mime:
                type:
                  - string
                  - 'null'
                description: >-
                  MIME type (e.g. `image/jpeg`, `video/mp4`); optional but
                  recommended
                maxLength: 255
              size:
                type: integer
                description: Declared file size in bytes (max 2 GB)
                minimum: 1
                maximum: 2147483648
            required:
              - name
              - size
          maxItems: 10
      required:
        - files
      title: PresignMediaContentRequest
    PresignedMediaUploadResource:
      type: object
      properties:
        id:
          type: string
          description: UUID of the pre-created (temporary) media item
        name:
          type: string
          description: Generated storage filename
        full_name:
          type: string
          description: Full relative storage key
        link:
          type: string
          description: Public read link (valid once the direct upload completes)
        upload_url:
          type: string
          description: Pre-signed URL the client must PUT the file bytes to
        upload_headers:
          type: string
          description: Headers that were signed and must be replayed on the PUT
        upload_method:
          type: string
          description: HTTP method to use for the direct upload
          enum:
            - PUT
        expires_in:
          type: string
          description: Seconds until the upload URL expires
      required:
        - id
        - name
        - full_name
        - link
        - upload_url
        - upload_headers
        - upload_method
        - expires_in
      title: PresignedMediaUploadResource
  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
    ModelNotFoundException:
      description: Not found
      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

````