Guides
Uploading media
Posts reference media by URL. Upload your own files with a signed URL, or point at any file that is already publicly reachable.
Upload in three steps
Ask for an upload URL
Call POST
/media/presignwith the file's name, type and exact size in bytes. Needs themedia:writescope.curl -X POST "https://dashboard.lifebliss.app/api/v1/media/presign" \ -H "Authorization: Bearer $PS_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filename": "talk.mp4", "contentType": "video/mp4", "size": 48213004 }'{ "uploadUrl": "https://…signed…", "publicUrl": "https://…/talk.mp4", "storageKey": "…", "method": "PUT", "expiresIn": 3600 }Upload the file
PUT the bytes to
uploadUrlwithin an hour, with the sameContent-Typeyou asked for. No API key — the URL is the permission.curl -X PUT "$UPLOAD_URL" \ -H "Content-Type: video/mp4" \ --data-binary @talk.mp4Attach it to a post
Use
publicUrlinmediaItems(or a target'scustomMedia).typeisimage,video,gifordocument.{ "content": "The full session is live.", "mediaItems": [ { "type": "video", "url": "PUBLIC_URL", "altText": "Recording of the evening session" } ], "targets": [{ "accountId": "YOUTUBE_ACCOUNT_ID" }], "publishNow": true }
In Node.js
import { readFile, stat } from "node:fs/promises";
const file = "talk.mp4";
const { size } = await stat(file);
const presign = await fetch(`${API}/media/presign`, {
method: "POST",
headers,
body: JSON.stringify({ filename: file, contentType: "video/mp4", size }),
}).then((r) => r.json());
await fetch(presign.uploadUrl, {
method: "PUT",
headers: { "Content-Type": "video/mp4" },
body: await readFile(file),
});
// presign.publicUrl now goes in mediaItemsUsing existing URLs
If the file is already online, skip the upload and put its URL straight into mediaItems. It must be publicly reachable over http(s); otherwise the post is refused with 422 media_unreachable, naming the URL. Adding size and durationMs when you know them lets each network's size and length limits be checked before publishing.
Types and limits
Uploads accept:
image/jpegimage/pngimage/webpimage/gifvideo/mp4video/quicktimevideo/webm
Up to 5 GB per file. Each network then applies its own limits on size, length and count — check them with GET/validate or POST/validate.