- CLI
- API
- From a link
The CLI does every step for you:It checks each file, uploads it (in parts when it’s large) and prints the media ID to pass to
postinger media upload photo.jpg video.mp4 https://example.com/banner.png
--media.1
Start the upload
Tell Postinger what you’re sending. Width, height and duration are yours to measure: the platform rules are checked against them.The answer has the
curl https://api.postinger.dev/v1/media \
-H "Authorization: Bearer $POSTINGER_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "fileName": "clip.mp4", "contentType": "video/mp4", "size": 52428800, "width": 1080, "height": 1920, "durationSeconds": 42.5 }'
media (with its id) and upload instructions.2
Send the bytes to storage
- If
upload.urlis set,PUTthe whole file there withupload.headers. - Otherwise, split the file into
upload.partSizepieces andPUTeach to itsupload.parts[].url, inpartNumberorder (part 1 starts at byte 0).
PUT of the same bytes is safe to repeat.3
Complete the upload
curl -X POST https://api.postinger.dev/v1/media/MEDIA_ID/complete \
-H "Authorization: Bearer $POSTINGER_API_KEY"
For a video, the answer may also carry
poster instructions: PUT a JPEG frame there, the same way, to choose the thumbnail. It’s optional.expiresAt.If the file is already online at a public The media is ready when this answers. MCP adds media this way.
https:// address, let Postinger fetch it:curl https://api.postinger.dev/v1/media/from-url \
-H "Authorization: Bearer $POSTINGER_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/banner.jpg", "fileName": "banner.jpg" }'
Attach it
Pass the media IDs asmediaIds when you create the post, or --media MEDIA_ID with the CLI.