Start multipart upload
Validate media type, size, and organization storage quota, create a PENDING editor asset, and issue presigned R2 multipart PUT URLs for direct-to-R2 upload. Save the response to a manifest and stream parts from disk with `npx @hitfactor/cli upload-parts --file <path> --manifest <manifest.json>` (or direct HTTP PUT) so binary bytes stay out of MCP payloads, then pass the returned ETags to editor_upload_complete. Costs 0 credits.
Request examples
curl -sS -X POST "https://hitfactorapp.com/api/v1/editor/uploads/start" \
-H "Content-Type: application/json" \
-H "x-api-key: $HITFACTOR_API_KEY" \
-d '{
"sessionId": "edsess_01j9example0000000000000",
"projectId": "proj_01j9example0000000000000",
"role": "clip",
"filename": "example_filename",
"size": 10,
"contentType": "example_contentType"
}'const response = await fetch("https://hitfactorapp.com/api/v1/editor/uploads/start", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-api-key": process.env.HITFACTOR_API_KEY!,
},
body: JSON.stringify({
"sessionId": "edsess_01j9example0000000000000",
"projectId": "proj_01j9example0000000000000",
"role": "clip",
"filename": "example_filename",
"size": 10,
"contentType": "example_contentType"
}),
})
const { data, meta } = await response.json()
console.log(data, meta)curl -sS -X POST "https://hitfactorapp.com/api/v1/mcp" \
-H "Content-Type: application/json" \
-H "x-api-key: $HITFACTOR_API_KEY" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "editor_upload_start",
"arguments": {
"sessionId": "edsess_01j9example0000000000000",
"projectId": "proj_01j9example0000000000000",
"role": "clip",
"filename": "example_filename",
"size": 10,
"contentType": "example_contentType"
}
}
}'Parameters
Idempotency-KeyheaderstringUnique retry key (up to 255 characters). Replaying the same key and body returns the original response with 0 extra credits charged.
maxLength: 255Request body
Send a JSON object with Content-Type: application/json. Unknown keys are rejected with 400 invalid_input.
sessionIdstringminLength: 1maxLength: 120projectIdstringminLength: 1maxLength: 120roleenum (5 values)default: "clip""screen""clip""acam""bcam""image"filenamestringrequiredminLength: 1maxLength: 300sizeintegerrequiredmax: 9007199254740991contentTypestringrequiredminLength: 1maxLength: 200durationSecondsnumbermin: 0syncToAssetIdstringminLength: 1maxLength: 120Response (200 OK)
Every successful response wraps the payload in data alongside billing and request metadata in meta.
assetIdstringrequiredsessionIdstringrequiredprojectIdstringrequirednullableuploadIdstringrequiredpartSizeintegerrequiredmax: 9007199254740991partUrlsstring (uri)[]requirededitUrlstring (uri)requirednullable{
"data": {
"assetId": "edasset_01j9example0000000000000",
"sessionId": "edsess_01j9example0000000000000",
"projectId": "proj_01j9example0000000000000",
"uploadId": "r2_multipart_upload_id_01",
"partSize": 10,
"partUrls": [
"https://example.com/resource"
],
"editUrl": "https://hitfactorapp.com/acme/videos/proj_01j9example0000000000000/edit"
},
"meta": {
"requestId": "req_01j9example0000000000000",
"creditsCharged": 1,
"creditsRemaining": 499,
"replayed": false
}
}Error responses
400invalid_input401Missing or invalid API key402insufficient_credits403insufficient_scope404operation_not_found409channel_sync_pending or idempotency_conflict429rate_limited