Skip to content

Complete multipart upload

Finalize a direct-to-R2 multipart upload, verify uploaded size against guardrails, mark images READY immediately (0 credits), or enqueue async video transcode/transcription processing (metered at 2 credits/min, min 1; 0 credits charged on failure).

POSThttps://hitfactorapp.com/api/v1/editor/uploads/complete
MCP tooleditor_upload_completeCost2 credits / min (images 0)ModeSync (200 OK)Scopeeditor:writeChannel syncNot required

Request examples

curl -sS -X POST "https://hitfactorapp.com/api/v1/editor/uploads/complete" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $HITFACTOR_API_KEY" \
  -H "Idempotency-Key: req_2026_001" \
  -d '{
  "sessionId": "edsess_01j9example0000000000000",
  "assetId": "edasset_01j9example0000000000000",
  "uploadId": "r2_multipart_upload_id_01",
  "parts": [
    {
      "partNumber": 1,
      "etag": "example_etag"
    }
  ]
}'

Parameters

Idempotency-Keyheaderstring

Unique retry key (up to 255 characters). Replaying the same key and body returns the original response with 0 extra credits charged.

maxLength: 255

Request body

Send a JSON object with Content-Type: application/json. Unknown keys are rejected with 400 invalid_input.

sessionIdstringrequired
minLength: 1maxLength: 120
assetIdstringrequired
minLength: 1maxLength: 120
uploadIdstringrequired
minLength: 1maxLength: 500
partsobject[]required
minItems: 1maxItems: 10000
Show item fields
partNumberintegerrequired
min: 1max: 10000
etagstringrequired
minLength: 1maxLength: 200
webhookUrlstring (uri)
maxLength: 2048

Response (200 OK)

Every successful response wraps the payload in data alongside billing and request metadata in meta.

assetIdstringrequired
sessionIdstringrequired
projectIdstringrequirednullable
editUrlstring (uri)requirednullable
status"queued" | "ready"required
assetStatus"PENDING" | "PROCESSING" | "COMPLETE" | "FAILED"required
operationIdstring
pollUrlstring
sizeBytesintegerrequirednullable
min: -9007199254740991max: 9007199254740991
creditsReservedintegerrequired
min: -9007199254740991max: 9007199254740991
Example 200 response
{
  "data": {
    "assetId": "edasset_01j9example0000000000000",
    "sessionId": "edsess_01j9example0000000000000",
    "projectId": "proj_01j9example0000000000000",
    "editUrl": "https://hitfactorapp.com/acme/videos/proj_01j9example0000000000000/edit",
    "status": "queued",
    "assetStatus": "PENDING",
    "operationId": "apiop_01j9example0000000000000",
    "pollUrl": "/api/v1/operations/apiop_01j9example0000000000000",
    "sizeBytes": -9007199254740991,
    "creditsReserved": -9007199254740991
  },
  "meta": {
    "requestId": "req_01j9example0000000000000",
    "creditsCharged": 1,
    "creditsRemaining": 499,
    "replayed": false
  }
}

Completed operation result

When the async operation reaches status: "succeeded", this schema is returned inside data.result on GET /operations/{operationId} and webhook deliveries.

assetIdstringrequired
sessionIdstringrequired
projectIdstringrequirednullable
editUrlstringrequirednullable
kindstringrequired
status"READY"required
assetStatus"COMPLETE"required
durationMsintegerrequirednullable
min: -9007199254740991max: 9007199254740991
durationSecondsnumberrequirednullable
widthintegerrequirednullable
min: -9007199254740991max: 9007199254740991
heightintegerrequirednullable
min: -9007199254740991max: 9007199254740991
hasAudiobooleanrequired
sizeBytesintegerrequirednullable
min: -9007199254740991max: 9007199254740991
proxyReadybooleanrequired
proxyUrlstringrequirednullable
Example completed result
{
  "assetId": "edasset_01j9example0000000000000",
  "sessionId": "edsess_01j9example0000000000000",
  "projectId": "proj_01j9example0000000000000",
  "editUrl": "https://hitfactorapp.com/acme/videos/proj_01j9example0000000000000/edit",
  "kind": "example_kind",
  "status": "READY",
  "assetStatus": "COMPLETE",
  "durationMs": -9007199254740991,
  "durationSeconds": 0.85,
  "width": -9007199254740991,
  "height": -9007199254740991,
  "hasAudio": true,
  "sizeBytes": -9007199254740991,
  "proxyReady": true,
  "proxyUrl": "https://example.com/resource"
}

Error responses

400invalid_input
401Missing or invalid API key
402insufficient_credits
403insufficient_scope
404operation_not_found
409channel_sync_pending or idempotency_conflict
429rate_limited