Media
Upload images and videos to attach to posts. Upload directly through the API, or request a signed URL and PUT the bytes straight to storage — best for large files.
Authentication & scope
Every endpoint needs an API key (Bearer lp_live_…) or a logged-in session, plus one scope:
media:write— upload media and mint signed upload URLs.
Allowed types & size
Max 500MB per file. The file extension must match the content type.
| Kind | Content types |
|---|---|
| Video | video/mp4, video/quicktime, video/x-msvideo, video/webm |
| Image | image/jpeg, image/png, image/webp, image/gif |
Direct upload
POST /v1/media/upload
Streams a multipart/form-data file to storage and returns a hosted URL you can attach to a post.
curl -X POST https://api.letspost.it/v1/media/upload \
-H "Authorization: Bearer $LETSPOST_KEY" \
-F "file=@clip.mp4;type=video/mp4"Response shape
{
"url": "https://storage.letspost.it/u/…/clip.mp4",
"storagePath": "users/uid/media/clip.mp4",
"fileName": "clip.mp4",
"size": 4823192,
"contentType": "video/mp4"
}Presigned upload URL
POST /v1/media/presign-upload
Issues a signed URL you PUT the file to directly. Body: { fileName, contentType }. The URL expires in 15 minutes.
curl -X POST https://api.letspost.it/v1/media/presign-upload \
-H "Authorization: Bearer $LETSPOST_KEY" \
-H "Content-Type: application/json" \
-d '{"fileName":"clip.mp4","contentType":"video/mp4"}'Response shape
{
"uploadUrl": "https://storage.googleapis.com/…?X-Goog-Signature=…",
"storagePath": "users/uid/media/clip.mp4",
"expiresAt": "2026-04-16T20:45:00.000Z"
}PUT the raw bytes to uploadUrl with the same Content-Type — no Authorization header on that request. Then use storagePath to attach the media to a post.
Batch presigned URLs
POST /v1/media/presign-upload/batch
Request up to 50 signed upload URLs at once. Body: { files: [{ fileName, contentType }, …] }.
curl -X POST https://api.letspost.it/v1/media/presign-upload/batch \
-H "Authorization: Bearer $LETSPOST_KEY" \
-H "Content-Type: application/json" \
-d '{
"files": [
{"fileName":"a.jpg","contentType":"image/jpeg"},
{"fileName":"b.mp4","contentType":"video/mp4"}
]
}'Response shape
{
"files": [
{ "uploadUrl": "https://…", "storagePath": "users/uid/media/a.jpg", "expiresAt": "…" },
{ "uploadUrl": "https://…", "storagePath": "users/uid/media/b.mp4", "expiresAt": "…" }
]
}Something unclear? Email us — we read every message.