Get video upload URL

Returns presigned URLs for uploading a video directly to S3 and retrieving it for analysis.

Workflow:

  1. Call this endpoint with the video filename and MIME type
  2. Use the returned uploadUrl to upload your video via HTTP PUT directly to S3
  3. Use the returned downloadUrl as the video_url parameter when calling analysis endpoints

Important:

  • Both URLs expire after 24 hours
  • The upload must be completed before the URL expires
  • Supported video types: MP4, MOV, AVI, WebM, MKV
  • Maximum filename length: 255 characters
POST
/api/video/upload-url

Authorization

AuthorizationBearer <token>required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

fileNamestringrequired

Original file name including extension. Max 255 characters. Must not contain special characters like < > : " / \ | ? *

Example"match-2024-01-15.mp4"
contentTypestringrequired

MIME type of the video file. Supported: video/mp4, video/quicktime (.mov), video/x-msvideo (.avi), video/webm, video/x-matroska (.mkv)

Example"video/mp4"

Response Body

Presigned URLs were successfully generated.

application/json
dataobjectoptional
uploadUrlstringrequired

Presigned PUT URL for direct S3 upload. Valid for 24 hours. Use HTTP PUT with the video file as body and Content-Type header matching the contentType parameter.

downloadUrlstringrequired

Presigned GET URL to pass to analysis endpoints. Valid for 24 hours. Use this URL as the `video_url` parameter when calling analysis endpoints like POST /api/statistics/tennis.

curl -X POST "https://example.com/api/video/upload-url" \  -H "Content-Type: application/json" \  -d '{    "fileName": "match-2024-01-15.mp4",    "contentType": "video/mp4"  }'
{  "data": {    "uploadUrl": "string",    "downloadUrl": "string"  }}