Start a video upload (step 1 of 3)
API reference

Start a video upload (step 1 of 3)

Starts a direct-to-CDN video upload and returns presigned TUS credentials.

View as MarkdownUpdated Aug 19, 2026
POST/api/external/vault/video-upload

Starts a direct-to-CDN video upload and returns presigned TUS credentials.

Videos cannot ride through POST /api/external/vault — the platform rejects request bodies over ~4MB before the app even runs. Instead: (1) call this to create the video and get credentials, (2) upload the raw bytes straight to the returned tusEndpoint with any TUS client, sending AuthorizationSignature, AuthorizationExpire, VideoId and LibraryId as TUS headers, (3) call complete with the completionToken. The full sequence with code is in the upload guide.

The CDN API key itself is never exposed — only a sha256 signature valid ~6 hours. The completion token is valid 8 hours.

Authentication

Send the creator's API key as a bearer token: Authorization: Bearer dpfn_…. See Authentication & API keys.

Request body

Content type: application/json

NameTypeRequiredDescription
originalNamestringRequiredThe video file name, stored as fileName.
fileSizeintegerOptionalOptional advisory byte count — obvious oversizes are rejected up front. The authoritative check runs at completion. Max 500MB.
Max: 524288000
Start an upload
{
  "originalName": "teaser.mp4",
  "fileSize": 52428800
}

Responses

200Upload created — feed these credentials to your TUS client.
NameTypeDescription
videoIdstringThe Bunny Stream GUID created for this upload. Send it back to the complete step, and use it as the TUS VideoId metadata.
tusEndpointstringThe TUS upload endpoint (https://video.bunnycdn.com/tusupload). Upload the raw file bytes here with a TUS client.
Format: uri
libraryIdstringBunny Stream library id — send as the LibraryId TUS header.
signaturestringPresigned sha256 — send as the AuthorizationSignature TUS header. The Stream API key itself is never exposed.
expiresintegerUnix timestamp (seconds) when the signature expires (~6 hours) — send as the AuthorizationExpire TUS header.
completionTokenstringHMAC token proving this upload was started by your key — required by the complete step. Valid 8 hours.
Example response
{
  "videoId": "c2f7f9e2-1111-4222-b333-4d55e6f7a8b9",
  "tusEndpoint": "https://video.bunnycdn.com/tusupload",
  "libraryId": "572783",
  "signature": "9b2f…64 hex…c1a0",
  "expires": 1755640800,
  "completionToken": "eyJ…"
}

Errors

StatusBodyWhen
400{"error":"Missing required field: originalName"}`originalName` absent or blank.
401{"error":"Unauthorized","code":"unauthorized"}Missing or invalid API key.
413{"error":"Video too large. Max 500MB."}The advisory fileSize exceeds 500MB.
500{"error":"Could not start the video upload"}CDN video creation failed — retry later.

Rate limiting

Every response carries the X-RateLimit-Tier header and, on limited tiers, the per-minute and per-day trios — read X-RateLimit-Remaining and X-RateLimit-Reset instead of hardcoding limits. Details in Rate limits.

Code samples

curl -X POST "https://www.dropfans.io/api/external/vault/video-upload" \
  -H "Authorization: Bearer $DROPFANS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "originalName": "teaser.mp4",
  "fileSize": 52428800
}'

Questions? [email protected]