Media upload
Upload files to Postkey, then use the public URL in a post.
Posts take media as public URLs in mediaItems. If your file already has a public URL, use it. If not, upload it to Postkey first.
Get an upload URL
curl -X POST https://api.postkey.dev/v1/media/upload \
-H "x-access-key: $POSTKEY_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "filename": "launch.mp4", "mimeType": "video/mp4", "sizeBytes": 18400000 }'{
"success": true,
"data": {
"uploadUrl": "https://uploads.postkey.dev/…?X-Amz-Signature=…",
"publicUrl": "https://media.postkey.dev/prj_1/launch.mp4"
}
}Upload the file
PUT the raw bytes to uploadUrl, with the same Content-Type. The URL is presigned and short-lived. It needs no API key.
curl -X PUT "$UPLOAD_URL" \
-H "Content-Type: video/mp4" \
--data-binary @launch.mp4Post with it
{
"content": "Launch day",
"mediaItems": [{ "type": "video", "url": "https://media.postkey.dev/prj_1/launch.mp4" }],
"platforms": [{ "platform": "linkedin", "accountId": "int_li_456" }],
"publishNow": true
}Media fields
| Field | Meaning |
|---|---|
type | image, video, gif or document (PDF, for LinkedIn document posts). |
url | A public URL that Postkey and the network can fetch without logging in. |
altText | Optional. Image description. Sent to networks that support it. |
thumbnail | Optional. Cover image for Facebook videos and regular YouTube videos. |
Limits
- Free projects can store up to 100 MB of media. Any paid plan or credit pack removes that cap.
- In the dashboard, files can be up to 150 MB each, with up to 10 files per post.
- Each network has its own size, length and format rules. They're listed on each platform page.
Delete a file you no longer need with DELETE /v1/media.