Skip to content

Uploads

For local files, you can’t pass a url to POST /v1/clips — the pipeline needs an http-reachable source. The uploads endpoint mints a one-time presigned S3 PUT URL you can stream the file to. The resulting upload_id flows into POST /v1/clips.

Auth: Bearer JWT or API key

FieldTypeRequiredDescription
content_typestringyesMIME type of the file you’ll upload, e.g. video/mp4, video/quicktime
Terminal window
curl -X POST https://api2.choppity.com/v1/uploads \
-H "Authorization: Key $CHOPPITY_KEY" \
-H "Content-Type: application/json" \
-d '{ "content_type": "video/mp4" }'
FieldTypeDescription
upload_idstringPass this as source.upload_id to POST /v1/clips
upload_urlstringPresigned S3 PUT URL — single-use, https-only
expires_atnumberUnix-ms timestamp when upload_url stops working
{
"upload_id": "9f8e7d6c-5b4a-3c2b-1a09-0f8e7d6c5b4a",
"upload_url": "https://choppity-assets-dev.s3.amazonaws.com/tmp/api-uploads/...",
"expires_at": 1745803600000
}

The signed PUT URL is valid for 1 hour. If your upload may take longer, mint the URL right before you start streaming.

The upload_id itself stays valid as long as the underlying S3 object exists — typically until the next overnight tmp cleanup.

  1. Mint the upload URL.

    Terminal window
    curl -X POST https://api2.choppity.com/v1/uploads \
    -H "Authorization: Key $CHOPPITY_KEY" \
    -H "Content-Type: application/json" \
    -d '{ "content_type": "video/mp4" }' \
    | tee upload.json
  2. PUT the file directly to S3.

    Terminal window
    curl -X PUT --upload-file ./podcast.mp4 \
    -H "Content-Type: video/mp4" \
    "$(jq -r .upload_url upload.json)"

    The Content-Type header must match what you sent in step 1 — S3 rejects PUTs that disagree.

  3. Start a clip job using the upload.

    Terminal window
    curl -X POST https://api2.choppity.com/v1/clips \
    -H "Authorization: Key $CHOPPITY_KEY" \
    -H "Content-Type: application/json" \
    -d "{
    \"source\": { \"upload_id\": \"$(jq -r .upload_id upload.json)\" },
    \"criteria\": \"funny moments\"
    }"

    The pipeline streams the uploaded file in via a short-lived presigned GET URL — no public hosting required on your side.

CodeWhen
BAD_REQUESTcontent_type missing or not a valid MIME type
UNAUTHORIZEDMissing or invalid credential