Presign Upload

Get a presigned URL to upload media.

POST /v1/media/presign

Get a presigned upload URL.

Auth: Bearer API key (required)

Request body

{
  "filename": "photo.jpg",
  "content_type": "image/jpeg",
  "size_bytes": 1048576
}
FieldTypeRequiredDescription
filenamestringYesOriginal filename
content_typestringYesMIME type (image/jpeg, video/mp4, etc.)
size_bytesintegerYesFile size in bytes

Response 200

{
  "upload_url": "https://...",
  "key": "uploads/{userId}/{storage_filename}",
  "storage_filename": "uuid.jpg"
}

cURL

curl -X POST https://api.social0.app/v1/media/presign \
  -H "Authorization: Bearer sk_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "filename": "photo.jpg",
    "content_type": "image/jpeg",
    "size_bytes": 1048576
  }'

Step 2 — Upload file

Upload directly to the presigned URL (no API key on this request):

curl -X PUT "$upload_url" \
  -H "Content-Type: image/jpeg" \
  --data-binary @photo.jpg

Set Content-Type to match the file's MIME type. Images and video use the same flow.