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

# Start media upload session

> This endpoint can be used to upload both smaller and larger files (up to 5GB) in a chunked manner.
Calling this creates an upload session and returns presigned URLs for uploading the file in parts.

Upload the file in `partCount` parts, using the matching
`parts[n].uploadUrl` for each part number.

Every part except the last must be exactly `partSizeInBytes` bytes. The
last part may be smaller. After all parts have been uploaded, call
`/media/upload-sessions/{uploadSessionId}/complete` to finalize the upload
and create the media item.




## OpenAPI

````yaml /openapi.yaml post /media/upload-sessions
openapi: 3.1.0
info:
  title: WoopSocial API
  version: 1.0.0
  summary: API for WoopSocial integrations.
  description: >
    This is the public-facing OpenAPI contract for WoopSocial. It supports
    scheduling posts for various social media platforms such as Facebook,
    Instagram, LinkedIn, LinkedIn Pages, Pinterest, Threads, TikTok, X (formerly
    Twitter) and YouTube.
servers:
  - url: https://api.woopsocial.com/v1
    description: WoopSocial API URL.
  - url: http://localhost:9123/api/external/v1
    description: Local WoopSocial API URL.
security: []
tags:
  - name: Posts
    description: Post scheduling endpoints.
  - name: Projects
    description: Project discovery endpoints.
  - name: Social Accounts
    description: Connected social account discovery endpoints.
  - name: Media
    description: Media upload endpoints.
  - name: Webhooks
    description: Webhook endpoint management.
  - name: Health
    description: Basic connectivity endpoints.
paths:
  /media/upload-sessions:
    post:
      tags:
        - Media
      summary: Start media upload session
      description: >
        This endpoint can be used to upload both smaller and larger files (up to
        5GB) in a chunked manner.

        Calling this creates an upload session and returns presigned URLs for
        uploading the file in parts.


        Upload the file in `partCount` parts, using the matching

        `parts[n].uploadUrl` for each part number.


        Every part except the last must be exactly `partSizeInBytes` bytes. The

        last part may be smaller. After all parts have been uploaded, call

        `/media/upload-sessions/{uploadSessionId}/complete` to finalize the
        upload

        and create the media item.
      operationId: createUploadSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUploadSessionRequest'
      responses:
        '200':
          description: Upload session created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadSession'
      security:
        - ApiKey: []
components:
  schemas:
    CreateUploadSessionRequest:
      type: object
      additionalProperties: false
      required:
        - projectId
        - fileSizeInBytes
      properties:
        projectId:
          type: string
          description: Project that will own the uploaded media.
        fileSizeInBytes:
          type: integer
          format: int64
          minimum: 1
          maximum: 5368709120
          description: Total size of the file that will be uploaded.
    UploadSession:
      type: object
      additionalProperties: false
      required:
        - uploadSessionId
        - partSizeInBytes
        - partCount
        - expiresAt
        - parts
      properties:
        uploadSessionId:
          type: string
          description: Media upload session identifier.
        partSizeInBytes:
          type: integer
          format: int64
          description: >
            Maximum chunk size to use when slicing the file into parts.


            For uploads with more than one part, every part except the last must

            be exactly this size. The last part may be smaller. For a
            single-part

            upload, the only part may be smaller than this size.
        partCount:
          type: integer
          format: int32
          description: Number of parts that must be uploaded before completion.
        expiresAt:
          type: string
          format: date-time
          description: Time when the presigned part upload URLs expire.
        parts:
          type: array
          description: Presigned upload targets, in part-number order.
          items:
            $ref: '#/components/schemas/UploadSessionPart'
            description: Presigned URL and part number for uploading one chunk of the file.
    UploadSessionPart:
      type: object
      additionalProperties: false
      required:
        - partNumber
        - uploadUrl
      properties:
        partNumber:
          type: integer
          format: int32
          minimum: 1
          description: 1-based part number to upload to this URL.
        uploadUrl:
          type: string
          format: uri
          description: Presigned URL that accepts the bytes for `partNumber`.
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      bearerFormat: API key

````