POST
/
collections
/
{collection_id}
/
youtube
Add a YouTube video to a collection
curl --request POST \
  --url https://api.cloudglue.dev/v1/collections/{collection_id}/youtube \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "url": "<string>",
  "metadata": {},
  "segmentation_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
  }
}'
{
  "collection_id": "<string>",
  "file_id": "<string>",
  "object": "collection_file",
  "added_at": 123,
  "status": "pending",
  "file": {
    "id": "<string>",
    "status": "pending",
    "bytes": 123,
    "created_at": 123,
    "filename": "<string>",
    "uri": "<string>",
    "metadata": {},
    "video_info": {
      "duration_seconds": 123,
      "height": 123,
      "width": 123,
      "format": "<string>",
      "has_audio": true
    },
    "thumbnail_url": "<string>",
    "source": "video"
  },
  "segmentation": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "pending",
    "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
    }
  }
}

Authorizations

Authorization
string
header
required

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

Path Parameters

collection_id
string
required

The ID of the collection to add the YouTube video to

Body

application/json

YouTube video URL parameters

url
string
required

The URL of the YouTube video to add to the collection.

Note that YouTube videos are currently limited to speech and metadata level understanding, for fully fledge multimodal video understanding please upload a file instead to the Files API and use that object instead as input.

metadata
object

User-provided metadata about the YouTube video

segmentation_id
string<uuid>

Segmentation job id to use. If not provided will use default to uniform 20s segmentation. Cannot be provided together with segmentation_config.

segmentation_config
object

Configuration for video segmentation. Cannot be provided together with segmentation_id.

Response

Successful video addition

collection_id
string
required

ID of the collection

file_id
string
required

ID of the file

object
enum<string>
required

Object type, always 'collection_file'

Available options:
collection_file
added_at
integer
required

Unix timestamp of when the file was added to the collection

status
enum<string>
required

Overall processing status of the file in this collection

Available options:
pending,
processing,
completed,
failed,
not_applicable
file
object

The file object

segmentation
object

Segmentation information for this file in the collection. Only present when the file has been segmented.