POST
/
files
/
{file_id}
/
segmentations
Create a new segmentation for a file
curl --request POST \
  --url https://api.cloudglue.dev/v1/files/{file_id}/segmentations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "strategy": "uniform",
  "uniform_config": {
    "window_seconds": 31,
    "hop_seconds": 30.5
  },
  "shot_detector_config": {
    "threshold": 1,
    "min_seconds": 31,
    "max_seconds": 31,
    "detector": "adaptive"
  },
  "start_time_seconds": 1,
  "end_time_seconds": 1
}'
{
  "segmentation_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "status": "pending",
  "created_at": 1,
  "file_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "segmentation_config": {
    "strategy": "uniform",
    "uniform_config": {
      "window_seconds": 31,
      "hop_seconds": 30.5
    },
    "shot_detector_config": {
      "threshold": 1,
      "min_seconds": 31,
      "max_seconds": 31,
      "detector": "adaptive"
    },
    "start_time_seconds": 1,
    "end_time_seconds": 1
  },
  "total_segments": 1,
  "data": {
    "object": "list",
    "segments": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "start_time": 123,
        "end_time": 123
      }
    ],
    "total": 123,
    "limit": 123,
    "offset": 123
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

file_id
string<uuid>
required

The ID of the file to segment

Body

application/json

Segmentation configuration

Configuration for video segmentation. Choose a strategy and provide ONLY the corresponding config:

uniform: Provide uniform_config, do NOT provide shot_detector_configshot-detector: Provide shot_detector_config, do NOT provide uniform_config

Optionally specify start_time_seconds and end_time_seconds to limit segmentation to a portion of the video.

Response

200
application/json

Segmentation created successfully

The response is of type object.