Media Upload
Upload media files via S3 presigned URLs. Supports images, videos, and GIFs up to 5 GB.
Get Presigned URL
POST /v1/media/presign
Generate a presigned S3 URL for direct upload. Use this for files larger than 4 MB or when you need guaranteed availability.
Request Body
{
"filename": "photo.jpg",
"contentType": "image/jpeg"
} Fields
filename— string (required) — Original filename with extensioncontentType— string (required) — MIME type (e.g. image/jpeg, video/mp4)
Examples
Python
import httpx
# Step 1: Get presigned URL
resp = httpx.post(
"https://api.socialsyncerapi.com/v1/media/presign",
headers={"Authorization": "Bearer sk_your_api_key"},
json={"filename": "photo.jpg", "contentType": "image/jpeg"}
)
data = resp.json()
upload_url = data["uploadUrl"]
public_url = data["publicUrl"]
# Step 2: Upload file directly to S3
with open("photo.jpg", "rb") as f:
httpx.put(
upload_url,
headers={"Content-Type": "image/jpeg"},
content=f.read()
)
print(f"Uploaded! Public URL: {public_url}") curl
# Step 1: Get presigned URL
curl -X POST https://api.socialsyncerapi.com/v1/media/presign \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{"filename": "photo.jpg", "contentType": "image/jpeg"}'
# Step 2: Upload to S3
curl -X PUT "PRESIGNED_URL" \
-H "Content-Type: image/jpeg" \
--data-binary @photo.jpg
# Step 3: Create post with the public URL
curl -X POST https://api.socialsyncerapi.com/v1/posts \
-H "Authorization: Bearer sk_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"content": "Check out this photo!",
"mediaItems": [{"type": "image", "url": "PUBLIC_URL"}],
"platforms": [{"platform": "instagram", "accountId": "ig_123"}],
"publishNow": true
}' Node.js
// Step 1: Get presigned URL
const presignResp = await fetch("https://api.socialsyncerapi.com/v1/media/presign", {
method: "POST",
headers: {
"Authorization": "Bearer sk_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({ filename: "photo.jpg", contentType: "image/jpeg" })
});
const { uploadUrl, publicUrl } = await presignResp.json();
// Step 2: Upload file
const fileBuffer = await readFile("photo.jpg");
await fetch(uploadUrl, {
method: "PUT",
headers: { "Content-Type": "image/jpeg" },
body: fileBuffer
});
console.log("Uploaded!", publicUrl); Response
{
"uploadUrl": "https://social-api-media.s3.amazonaws.com/media/...",
"publicUrl": "https://social-api-media.s3.amazonaws.com/media/...",
"key": "media/owner123/abc123.jpg",
"expiresIn": 3600
} Supported Formats
- Images: JPEG, PNG, GIF, WebP
- Videos: MP4, MOV, WebM
- GIFs: Animated GIF
Limits
- Max file size: 5 GB
- URL expiry: 1 hour
- Storage: Files auto-deleted after 7 days
Alternative: Direct URL
If your media is already hosted on a CDN, you can skip the upload step and use the URL directly in your post's mediaItems. The URL must be:
- Publicly accessible (no authentication required)
- Returning actual media bytes with the correct
Content-Typeheader - Not behind redirects that resolve to HTML pages
- Hosted on a fast, reliable CDN
These do NOT work: Google Drive, Dropbox, OneDrive, iCloud sharing links. They return HTML pages, not media files. Test your URL in an incognito browser window.