> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudglue.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Detect Faces in Video

> Analyze video to detect all faces



## OpenAPI

````yaml POST /face-detect
openapi: 3.0.0
info:
  title: Cloudglue API
  description: API for Cloudglue
  license:
    name: Apache License 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
  version: 0.7.9
servers:
  - url: https://api.cloudglue.dev/v1
security:
  - bearerAuth: []
paths:
  /face-detect:
    post:
      tags:
        - Face Detection
      summary: Detect faces in video
      description: Analyze video to detect all faces
      operationId: createFaceDetection
      requestBody:
        description: Face detection request parameters
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FaceDetectionRequest'
        required: true
      responses:
        '200':
          description: Face detection job created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FaceDetection'
        '400':
          description: Invalid request parameters or configuration
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Target video file not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Monthly face detection jobs limit reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: An unexpected error occurred on the server
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    FaceDetectionRequest:
      type: object
      required:
        - url
      properties:
        url:
          type: string
          description: URL of the target video to analyze
        frame_extraction_id:
          type: string
          format: uuid
          description: 'Optional: Use previously extracted frames'
        frame_extraction_config:
          $ref: '#/components/schemas/FrameExtractionConfig'
          description: 'Optional: Frame extraction configuration'
    FaceDetection:
      type: object
      required:
        - face_detection_id
        - status
        - created_at
      properties:
        face_detection_id:
          type: string
          format: uuid
          description: Unique identifier for the face detection job
        frame_extraction_id:
          type: string
          format: uuid
          description: ID of the frame extraction used
        file_id:
          type: string
          format: uuid
          description: ID of the target file
        status:
          type: string
          enum:
            - pending
            - processing
            - completed
            - failed
          description: Status of the face detection job
        created_at:
          type: number
          description: Unix timestamp in milliseconds when the job was created
        data:
          type: object
          description: Face detection results (only present when status is completed)
          properties:
            object:
              type: string
              enum:
                - list
              description: Object type, always 'list'
            total:
              type: integer
              description: Total number of faces detected
            limit:
              type: integer
              minimum: 1
              maximum: 100
              description: Number of faces returned per page
            offset:
              type: integer
              minimum: 0
              description: Offset from the start of the faces list
            faces:
              type: array
              items:
                $ref: '#/components/schemas/DetectedFace'
              description: Array of detected faces
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
    FrameExtractionConfig:
      type: object
      description: >-
        Configuration for frame extraction. Currently only supports uniform
        strategy.
      required:
        - strategy
      properties:
        strategy:
          type: string
          enum:
            - uniform
          description: Frame extraction strategy - currently only 'uniform' is supported
        uniform_config:
          $ref: '#/components/schemas/FrameExtractionUniformConfig'
          description: Configuration for uniform frame extraction
        thumbnails_config:
          $ref: '#/components/schemas/FrameExtractionThumbnailsConfig'
          description: Configuration for frame thumbnails. Optional.
        start_time_seconds:
          type: number
          minimum: 0
          description: >-
            Optional: The start time of the video in seconds to start extracting
            frames from
        end_time_seconds:
          type: number
          minimum: 0
          description: >-
            Optional: The end time of the video in seconds to stop extracting
            frames at
    DetectedFace:
      type: object
      required:
        - id
        - face_bounding_box
        - frame_id
        - timestamp
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the detected face
        face_bounding_box:
          $ref: '#/components/schemas/FaceBoundingBox'
          description: Bounding box of the detected face in the frame
        frame_id:
          type: string
          format: uuid
          description: ID of the frame where the face was detected
        timestamp:
          type: number
          description: Timestamp of the frame in seconds
        thumbnail_url:
          type: string
          description: URL of the frame thumbnail (if frame extraction enabled thumbnails)
    FrameExtractionUniformConfig:
      type: object
      description: Configuration for uniform frame extraction
      properties:
        frames_per_second:
          type: number
          minimum: 0.1
          maximum: 30
          description: Number of frames to extract per second of video
        max_width:
          type: number
          minimum: 64
          maximum: 4096
          description: >-
            Maximum width of extracted frames in pixels. Aspect ratio is
            preserved.
    FrameExtractionThumbnailsConfig:
      type: object
      description: Configuration for frame thumbnails
      properties:
        enable_frame_thumbnails:
          type: boolean
          description: Whether to generate CDN-hosted thumbnails for extracted frames
    FaceBoundingBox:
      type: object
      required:
        - height
        - width
        - top
        - left
      properties:
        height:
          type: number
          minimum: 0
          maximum: 1
          description: Height of the bounding box (normalized 0-1)
        width:
          type: number
          minimum: 0
          maximum: 1
          description: Width of the bounding box (normalized 0-1)
        top:
          type: number
          minimum: 0
          maximum: 1
          description: Top position of the bounding box (normalized 0-1)
        left:
          type: number
          minimum: 0
          maximum: 1
          description: Left position of the bounding box (normalized 0-1)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````