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,
  "thumbnails_config": {
    "enable_segment_thumbnails": true
  }
}'
{
  "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
  },
  "thumbnails_config": {
    "enable_segment_thumbnails": true
  },
  "total_segments": 1,
  "data": {
    "object": "list",
    "segments": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "start_time": 123,
        "end_time": 123,
        "thumbnail_url": "<string>"
      }
    ],
    "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

Segmentation configuration (root level) with optional thumbnails 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.

strategy
enum<string>
required

Segmentation strategy - determines which config you must provide

Available options:
uniform,
shot-detector
thumbnails_config
object

Configuration for segment thumbnails. Optional.

uniform_config
object

🎯 REQUIRED when strategy = 'uniform' - Configuration for uniform segmentation. Do NOT provide when using shot-detector strategy.

shot_detector_config
object

🎯 REQUIRED when strategy = 'shot-detector' - Configuration for shot detection segmentation. Do NOT provide when using uniform strategy.

start_time_seconds
number

Optional: The start time of the video in seconds to start segmenting from

Required range: x >= 0
end_time_seconds
number

Optional: The end time of the video in seconds to stop segmenting at

Required range: x >= 0

Response

Segmentation created successfully

segmentation_id
string<uuid>
required

Unique identifier for the segmentation job

status
enum<string>
required

Status of the segmentation job. If a job has the status 'not_applicable' it means that we were unable to find any appropriate scenes for this video. This can be possible if you use the shot-detector strategy.

Available options:
pending,
processing,
completed,
failed,
not_applicable
created_at
number
required

Unix timestamp of when the segmentation was created

Required range: x >= 0
file_id
string<uuid>
required

ID of the file this segmentation belongs to

segmentation_config
object
required

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.

thumbnails_config
object
required
total_segments
number

Total number of segments in this segmentation (only present when status is completed)

Required range: x >= 0
data
object

Segment data with pagination (only present when status is completed and segments exist)