Skip to Content

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 }'
Response
{
  "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.

Upload
curl -X PUT "$UPLOAD_URL" \
  -H "Content-Type: video/mp4" \
  --data-binary @launch.mp4

Post with it

Request body
{
  "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

FieldMeaning
typeimage, video, gif or document (PDF, for LinkedIn document posts).
urlA public URL that Postkey and the network can fetch without logging in.
altTextOptional. Image description. Sent to networks that support it.
thumbnailOptional. 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.

On this page