DocumentationGet Multipart Part URLs

Get Multipart Part URLs

Request presigned URLs for uploading file parts. Call this after creating the upload to get URLs for each file part.

Endpoints

POST/api/videos/uploads/:jobId/files/:uploadId/part-urls

Get presigned URLs for file parts.

Request

curl -X POST "https://theamplium.com/api/videos/uploads/JOB_ID/files/UPLOAD_ID/part-urls" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
    "startPartNumber": 1,
    "count": 3
  }'

Response

{
  "uploadId": "a4d7985f-7a8d-4f9c-9d34-3b6264f02222",
  "layout": "AIV",
  "partSizeBytes": 104857600,
  "totalParts": 3,
  "parts": [
    {
      "partNumber": 1,
      "byteStart": 0,
      "byteEnd": 104857599,
      "url": "https://signed-r2-url.example/part-1"
    },
    {
      "partNumber": 2,
      "byteStart": 104857600,
      "byteEnd": 209715199,
      "url": "https://signed-r2-url.example/part-2"
    },
    {
      "partNumber": 3,
      "byteStart": 209715200,
      "byteEnd": 249999999,
      "url": "https://signed-r2-url.example/part-3"
    }
  ]
}

Error Response

When an error occurs, the API returns a JSON response with this structure:

{
  "error": "BadRequest",
  "message": "isEncode must be true or false."
}

HTTP Error Codes

CodeError Type
400BadRequest
401Unauthorized
403Forbidden
404NotFound
413PayloadTooLarge
415UnsupportedMediaType
500InternalServerError

Request Parameters

ParameterTypeRequiredDescription
startPartNumberintegerRequiredFirst part number to request. Must be a positive integer.
countintegerRequiredNumber of part URLs to return. Must be a positive integer.

Next Steps

After receiving the presigned URLs:

  1. Upload each part with PUT to its URL.
  2. Save the response ETag header for every part.
  3. Use the saved ETags when calling the Complete Upload endpoint.