Media

Upload with a token

Changed on

Upload a file to a one-time URL from POST /media/create-upload-url. No API key: the upload_token query parameter is the auth, valid once for 10 minutes. Takes the same files as POST /media/upload (images, video, PDF; up to 100 MB). If storage is briefly down (503), the token stays valid and the same request can be sent again.

post/media/upload-by-token

Request

  • Base URL
    https://api.omnisocials.com/v1
  • URL
    https://api.omnisocials.com/v1/media/upload-by-token
  • Auth
    none required

Query parameters

upload_tokenstring required
Example:9f2c4e1ab07d

The token from POST /media/create-upload-url.

Request body multipart/form-data

filestring binary required

An image, video or PDF, up to 100 MB.

namestring

Optional label so the file is findable by name later.

pdf_mode'slides' | 'document'

PDF uploads only, as on POST /media/upload.

Example request

{
  "name": "autumn-menu-hero"
}

Response

The stored file. For an image or video, data is the media item. For a PDF the body is a PdfUploadResult.

OR

Example response

{
  "id": "123",
  "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
        }
      ]
    }
  },
  "status": "ready"
}

Changes