Skip to content
Docs menu

Media

Upload files, import public URLs, and reuse media from your library.

On this page

Import from cloud storage

Use Import from in Compose or Media to choose files from Google Drive, Dropbox, or Canva. Copy an import token for one selected file and use it with POST /api/v1/media/import/cloud or MCP's import_from_cloud. The token lasts ten minutes and is scoped to the workspace.

In Media, you can watch a Drive or Dropbox folder for new files and save them to the library or schedule them for publishing.

Upload through a presigned URL

  1. Send POST /api/v1/media/uploads with mimeType, sizeBytes, and optionally fileName. Files can be up to 1 GiB. Video metadata fields are durationSeconds, width, and height.
  2. PUT the raw bytes to uploadUrl within expiresIn seconds (15 minutes). Use the returned Content-Type and If-None-Match headers and the exact content length. Send your Posthoop API key only to the Posthoop origin.
  3. Send POST /api/v1/media/{id}/complete to verify the upload and show it in the library. Creating a post with the ID verifies and completes a pending upload as well.

Accepted formats are MP4, MOV, WebM, JPEG, PNG, WebP, and PDF for LinkedIn document posts. YouTube requires dimensions and duration. TikTok videos require duration. Individual platforms can restrict formats and file sizes further.

For a batch of up to 50 files, send {"files": [...]} to the same endpoint. The uploads array is in input order. PUT and complete each file individually.

See the quickstart for the complete upload sequence in curl and JavaScript.

Import a file from a URL

Send POST /api/v1/media/import with a direct public HTTP or HTTPS file URL. The source must respond on the standard port and serve uncompressed media. Imports allow up to 100 MiB per file and follow up to three redirects. Pass video dimensions or duration in the same fields as an upload.

JSON request body
{
  "url": "https://media.example.com/studio.jpg"
}

The 201 response includes an id, mimeType, sizeBytes, and any supplied video metadata. The media is ready to attach. If imports are busy, see rate limits and errors.

Find and remove library items

Use GET /api/v1/media?q=studio&limit=24&offset=0 to list ready media. Search matches filenames, MIME types, or IDs. Use the returned nextOffset for the next page. When it is null, you have reached the end.

usage totals cover the workspace library, including video posters, regardless of the query. thumbnailUrl is a short-lived signed URL for an image or a video poster when one is available.

A Publishing admin key can call DELETE /api/v1/media/{id}. A successful delete returns 204. If a post still needs the file, the API returns 409.