Skip to main content
By the end of this page you’ll have a file in the creator’s media with a mediaUuid you can attach to a message or post. Uploads are multipart: you open a session, upload each part to a signed URL, complete the session and poll until the media is ready. You need an access token with the write:media scope, and a file of up to 1.5 GiB, or 100 MiB for a document. Agencies use the creator-scoped routes, covered in Agency uploads.

Step 1: Create the session

POST /media/uploads creates a media record and opens the session. mediaType is image, video, audio or document. Pass sizeBytes when you know it, so the response includes the exact totalParts.
A sizeBytes over the platform maximum, or over 100 MiB for a document, returns 400.

Step 2: Sign the parts

GET /media/uploads/{uploadId}/parts/urls?from=1&to=12 returns signed URLs for a contiguous range of part numbers in one request. Part numbers are 1-based.
Signed URLs are valid for a limited time, so for a slow upload sign the range you are about to send rather than the whole file. A to higher than maxParts returns 413. GET /media/uploads/{uploadId}/parts/{partNumber}/url signs one part and returns the bare URL as text/plain. Use it for a single-part retry, and use the range route otherwise, because it costs one request against your rate limit instead of one per part.

Step 3: Upload the bytes

PUT the raw bytes of each part to its signed URL, with no Authorization header. Record the ETag response header for every part, because the completion call needs it.

Step 4: Complete the session

Send PATCH /media/uploads/{uploadId} with every part number and its ETag.
The response status is processing, not ready, because transcoding and moderation run after this call. The document size ceiling is enforced here, against the uploaded bytes.

Step 5: Poll until ready

Call GET /media/{uuid} with the mediaUuid from step 1 until status is ready or error.
On error, errorReason names the cause; Check processing status lists the values.
Attach media to a message or post only after status is ready. Media attached while processing reaches the recipient before they can open it. If you attached too early, wait for ready and send again.

Upload a file in parts with TypeScript

This script runs all five steps for one file.

With the SDK

createFanvueClient().vault wraps steps 1, 2, 4 and 5 as createUploadSession, getUploadPartUrl, completeUpload and getMedia. pollUntilReady from the media helpers polls getMedia every 1.5 seconds for up to 300 seconds and returns ready, error or timeout. See SDK API client.

Agency uploads

The creator-scoped routes mirror the self-serve ones under /creators/{creatorUserUuid}/media/uploads* and need write:creator and write:media. The creator-scoped single-part URL route has its own limit of 1000 requests per minute; the range route costs one request however many parts it signs.

Limits

audio is a voice note. Upload it the same way, wait for ready, then attach the mediaUuid to a chat message.

See also