Skip to content
Connect an agent

Build

Images and video

Attach images or a video to a post: upload the file, or let Flung fetch it from a link, then pass its id in mediaIds.

TL;DR

QuestionAnswer
Which files?JPEG, PNG and WebP up to 20 MB, GIF up to 15 MB, and MP4 and QuickTime up to 1 GB. Flung reads the real type from the file itself.
How do I upload?Reserve the file, send its bytes, and use it once it is ready. Files over 100 MB go in parts. The SDK does all of it in one call.
Can Flung fetch a file from a link?Yes: import it from a public https address.
Does a video get a thumbnail?Yes, a frame one second in, for showing beside the file. Posts never wait for it.

Upload with the SDK

ts
const image = await flung.uploadMedia(await readFile('launch.png'), { contentType: 'image/png', filename: 'launch.png' })await flung.posts.create({ content: 'Launching today.', accountIds, mediaIds: [image.id] })
bash
curl -X POST 'https://api.flung.dev/v1/media/import' \  --header "Authorization: Bearer $FLUNG_API_KEY" \  --header 'Content-Type: application/json' \  --header "Idempotency-Key: $(uuidgen)" \  --data '{  "url": "https://example.com/launch.jpg"}'

What each platform takes

Each platform's own limits apply on top of Flung's, such as Bluesky's 1 MB images or X's four images a post. List platforms gives every limit, and a post a platform cannot carry is refused when you create it.