Skip to content

Media

A Post’s media is a list of files, in the order they should appear. Each one is either a file you uploaded, { "assetId": "…" }, or a public web address Pubrivo fetches, { "url": "https://…" }. Both take an optional altText.

Pubrivo takes JPEG, PNG, WebP, MP4 and MOV, up to 2 GB a file, and converts each one to what every Network in the Post accepts. Files count against your plan’s storage.

  1. Reserve the upload with the file’s name, type and size.

    Terminal window
    curl https://app.pubrivo.com/api/media \
    -H "Authorization: Bearer $PUBRIVO_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "filename": "buns.jpg", "contentType": "image/jpeg", "bytes": 482113 }'
    { "data": { "assetId": "0d9c…", "uploadUrl": "https://…" } }
  2. PUT the file to uploadUrl, with the same Content-Type, within 15 minutes. No Authorization header: the address is signed. curl -T streams the file rather than reading it into memory first.

    Terminal window
    curl -T buns.jpg -H "Content-Type: image/jpeg" "$UPLOAD_URL"
  3. Confirm it arrived. One that did not arrive whole — the PUT failed, or the 15 minutes ran out — is refused with upload_incomplete and removed; reserve it again.

    Terminal window
    curl -X POST https://app.pubrivo.com/api/media/$ASSET_ID/complete \
    -H "Authorization: Bearer $PUBRIVO_KEY"
  4. Use it in a Post: "media": [{ "assetId": "0d9c…", "altText": "A tray of cardamom buns" }].

An upload not yet in a Post can be removed with DELETE /api/media/{id}, which frees its storage at once. An upload belongs to one Post: using it in a second one is refused with media_unavailable.

Completion confirms that the original file arrived, not that it is ready for every Network. Network preparation starts after a Post targets the file. Scheduling while preparation is still running is expected: read GET /api/posts/{id} (MCP: get_post) and check each Variant’s mediaReady. scheduled means queued; mediaReady means its files are prepared; published means the Network accepted publication. A Variant that fails reports failureReason and failureDetail. Readiness before creating a Post is not currently exposed.

Name a public https address and Pubrivo fetches the file before publishing:

{
"text": "Saturday's tray.",
"channelIds": ["5b0b6c1e-9f4a-4a57-8d1e-2c3f4a5b6c7d"],
"scheduledAt": "2027-01-23T07:00:00Z",
"media": [{ "url": "https://cdn.example.com/buns.jpg", "altText": "A tray of cardamom buns" }]
}

When the Post is created, Pubrivo asks the address what it holds — its type and size — and refuses the Post at once if that is not something it takes. The file itself is fetched afterwards, and checked again: if it has changed into something else, grown larger, or the address stops answering, the Post’s Variants fail with media_problem and the reason.

The address must be https://, on the standard port, and reachable from the public internet. One that points into a private network is refused.

Instagram, TikTok and YouTube need at least one file; how many, and of which kind, differs by Network. See network limits. A Post that breaks one is refused with a blocker naming the Channel.