RelayAPI
Guides

Media Uploads

Upload images, videos, and other media to include in your posts.

Overview

RelayAPI supports media uploads through pre-signed URLs. Upload media first, then reference it in your posts.

Upload Flow

  1. Request a pre-signed upload URL via POST /v1/media/upload
  2. Upload your file directly to the pre-signed URL
  3. Reference the media ID in your post's content
# Step 1: Get upload URL
curl -X POST https://api.relayapi.dev/v1/media/upload \
  -H "Authorization: Bearer rlay_live_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"filename": "photo.jpg", "mime_type": "image/jpeg", "size": 1048576}'

# Step 2: Upload to the pre-signed URL
curl -X PUT "https://media.relayapi.dev/upload/..." \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg

Supported Formats

TypeFormatsMax Size
ImageJPEG, PNG, GIF, WebP10 MB
VideoMP4, MOV, AVI100 MB
DocumentPDF25 MB

Platform-Specific Limits

Each platform has its own media requirements. RelayAPI automatically validates and, where possible, converts media to meet platform specifications. See individual platform pages for details.

Found something wrong? Help us improve this page.

On this page

Submit an Issue
Requires a GitHub account.View repo