Media
Upload images and videos to Marsial before posting them.
Get an upload URL
Section titled “Get an upload URL”POST
/v1/media/upload-urlJPEG, PNG, WebP and GIF up to 20 MB; MP4, MOV and WebM up to 1 GB. PUT the file to uploadUrl, then post publicUrl.
Body
filenamestringrequiredcontentTypestringrequiredsizeintegerrequired
Response 200
data
uploadUrlstring (uri)requiredPre-signed URL: PUT the file there with the same Content-Type.
publicUrlstring (uri)requiredUse it in a post's media once uploaded.
kindstringrequiredexpiresInintegerrequiredSeconds the upload URL stays valid.
curl -X POST "https://api.marsial.dev/v1/media/upload-url" \ -H "Authorization: Bearer $MARSIAL_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "filename": "autumn.mp4", "contentType": "video/mp4", "size": 48211234 }'const res = await fetch('https://api.marsial.dev/v1/media/upload-url', { method: 'POST', headers: { Authorization: `Bearer ${process.env.MARSIAL_API_KEY}`, 'Content-Type': 'application/json', }, body: JSON.stringify({ "filename": "autumn.mp4", "contentType": "video/mp4", "size": 48211234 }),});const { data } = await res.json();import os, requests
res = requests.post( "https://api.marsial.dev/v1/media/upload-url", headers={"Authorization": f"Bearer {os.environ['MARSIAL_API_KEY']}"}, json={ "filename": "autumn.mp4", "contentType": "video/mp4", "size": 48211234 },)data = res.json()["data"]© 2026 Marsial by TWOFACES ·marsial.dev ·Dashboard ·soporte@twofacesco.com