Media

Upload from base64

Changed on

Upload a file from base64-encoded data. Useful for MCP integrations where the AI has image data but no URL. Accepts images, video, and PDF (a PDF is split into image slides and returned as a carousel, see PdfUploadResult; pass all of media_ids to POST /posts). Max 100MB after decoding; per-platform caps apply at scheduling (Mastodon 99MB, Bluesky 100MB, X 512MB free tier, Threads/Reddit 1GB, Pinterest 2GB, Facebook/Instagram/TikTok 4GB, LinkedIn 5GB, YouTube 256GB).

post/media/upload-from-base64

Request

  • Base URL
    https://api.omnisocials.com/v1
  • URL
    https://api.omnisocials.com/v1/media/upload-from-base64
  • Auth
    HTTP bearer

Request body

datastring required

Base64-encoded file data (without data URI prefix)

mime_typestring required

MIME type of the file (e.g. image/jpeg, image/png, application/pdf)

filenamestring

Optional filename

namestring

Optional human-readable label so the asset is findable by name later (e.g. "pp-play5get50").

folderstring

Optional folder name to file the asset under (created at the top level if missing).

folder_idstring

Optional id of an existing folder to file the asset under.

pdf_mode'slides' | 'document'

PDF uploads only. slides (default): one image media item per page, one id each; pass ALL of media_ids to POST /posts. document: ONE media item for the whole PDF (type document, its pages in pdf.pages); pass its single id in media_ids and the post gets every page, in order. Both modes keep the original file, which LinkedIn receives when the pages are posted unchanged.

Example request

{
  "mime_type": "image/jpeg",
  "filename": "autumn-menu.jpg",
  "name": "autumn-menu-hero",
  "folder": "Autumn campaign",
  "folder_id": "12"
}

Response

File uploaded successfully. A single data (Media) for image/video; a PdfUploadResult (slides + media_ids) for a PDF.

OR

Example response

{
  "data": {
    "id": "482913",
    "url": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-k3j9xq_0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70.jpg",
    "thumbnail_url": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/thumbnails/1792573200000-k3j9xq_0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70_thumbnail.webp",
    "name": "autumn-menu-hero",
    "folder_id": "12",
    "filename": "0c9e6b1a-2f4d-4b8e-a7c3-9d1e5f6a2b70.jpg",
    "size": "2.50 MB",
    "created_at": "2026-10-20T14:32:10.000Z",
    "pdf": {
      "id": "9a7e3c1f-5b2d-4e8a-b6c4-1f3d5e7a9b20",
      "name": "deck.pdf",
      "url": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-p7m2wd_9a7e3c1f-5b2d-4e8a-b6c4-1f3d5e7a9b20.pdf",
      "page": 1,
      "total_pages": 8,
      "rendered_pages": 8,
      "pages": [
        {
          "url": "https://cdn.omnisocials.com/file/library-omnisocials/312a658f-2b45-4289-b240-890807221a74/library/1792573200000-p7m2wd_4c2e8a6f-1d3b-4f5a-9e7c-0b2d4f6a8c13.png",
          "width": 1080,
          "height": 1350
        }
      ]
    }
  }
}

Changes

    • info

      added the non-success response with the status

    • warning

      added the new document enum value to the ///// response property for the response status

    • warning

      added the new document enum value to the ////// response property for the response status

    • warning

      added the new document enum value to the // response property for the response status

    • info

      added the new optional request property

    • info

      added the optional property ///// to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      added the optional property ///// to the response with the status

    • info

      added the optional property ////// to the response with the status

    • info

      added the optional property // to the response with the status