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.
POST /v1/uploads
Section titled “POST /v1/uploads”Auth: Bearer JWT or API key
Request body
Section titled “Request body”| Field | Type | Required | Description |
|---|---|---|---|
content_type | string | yes | MIME type of the file you’ll upload, e.g. video/mp4, video/quicktime |
curl -X POST https://api2.choppity.com/v1/uploads \ -H "Authorization: Key $CHOPPITY_KEY" \ -H "Content-Type: application/json" \ -d '{ "content_type": "video/mp4" }'Response · 201 Created
Section titled “Response · 201 Created”| Field | Type | Description |
|---|---|---|
upload_id | string | Pass this as source.upload_id to POST /v1/clips |
upload_url | string | Presigned S3 PUT URL — single-use, https-only |
expires_at | number | Unix-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}URL TTL
Section titled “URL TTL”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.
End-to-end flow
Section titled “End-to-end flow”-
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 -
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-Typeheader must match what you sent in step 1 — S3 rejects PUTs that disagree. -
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.
Errors
Section titled “Errors”| Code | When |
|---|---|
BAD_REQUEST | content_type missing or not a valid MIME type |
UNAUTHORIZED | Missing or invalid credential |