openapi: 3.1.0
info:
title: Welcome to Imentiv AI AI Insights API Video Emotion API API
description: "# Welcome to Imentiv AI\n\nImentiv AI is an advanced Emotion AI platform that leverages deep learning to analyze human emotions across multiple media formats, including video, audio, images, and text. By interpreting facial expressions, vocal tones, and linguistic cues, it provides detailed emotional insights to support use cases such as content creation, marketing optimization, education, mental health assessments, and more.\n\nImentiv AI offers a suite of Emotion Recognition APIs that allow developers and businesses to seamlessly integrate advanced emotion analysis into their applications, enabling deeper insights into user engagement and emotional responses.\n\n## Key Features of Imentiv AI APIs\n\n### 1. Video Emotion API\n**Functionality:** Analyzes emotions in videos, whether uploaded directly or via YouTube links.\n\n**Insights Provided:**\n- Frame-by-frame and actor-by-actor emotion analysis\n- Valence-arousal mapping to determine emotional intensity and positivity/negativity\n- Personality trait analysis using the Big Five (OCEAN) model\n- Emotion graphs and wheels to visualize emotional dynamics\n\n**Use Cases:** Suitable for researchers analyzing bulk videos, advertising campaigns, webinars, online meetings, and other video-based content to optimize engagement and content strategy.\n\n### 2. Image Emotion API\n**Functionality:** Detects and analyzes emotions in images.\n\n**Insights Provided:**\n- Face detection and recognition\n- Emotion analysis for each detected face\n- Overall emotional tone of the image\n\n**Use Cases:** Enhances image analysis for advertising, market research, psychological studies, and social media content.\n\n### 3. Audio Emotion API\n**Functionality:** Analyzes emotions in audio recordings, either via direct uploads or by extracting audio from YouTube videos.\n\n**Insights Provided:**\n- Differentiation between multiple speakers in a conversation\n- Emotion detection from vocal cues (e.g., happiness, sadness, anger, surprise)\n- Transcription and detection of up to 28 nuanced emotions (e.g., admiration, curiosity, disappointment, pride)\n- Audio summaries and detailed analytics\n\n**Use Cases:** Provides emotional insights for podcasts, voice messages, call analysis, and other audio-based content.\n\n### 4. Text Emotion API\n**Functionality:** Analyzes emotions in textual content.\n\n**Insights Provided:**\n- Detection of 28 distinct emotions, including curiosity, disappointment, and excitement\n- Overall sentiment analysis and identification of dominant emotions at sentence level\n\n**Use Cases:** Integrates into chatbots, social media platforms, and other text-based applications for sentiment and emotion analysis.\n\n---\n\n## Authorization\n\nLearn how to obtain your API keys to access Imentiv AI APIs.\n\n### Generate API Key:\n\n1. **Sign up** at [imentiv.ai](https://imentiv.ai) and log in to your account.\n2. Navigate to the **'My Profile'** tab to obtain your API key.\n3. Use this API key to authorize your API calls.\n\n> **Note:** Keep your API key secure and do not share it publicly. Include it in your API requests using the `Authorization` header or as specified in the endpoint documentation.\n "
version: 1.0.0
tags:
- name: Video Emotion API
description: "The Video Emotion Analysis API by Imentiv analyzes the emotional states of individuals in a video. It performs multi-modal emotion detection using facial expressions, audio, and text transcript, and has the following features:\n\n- Overall emotion summary\n- Frame-by-frame emotion data\n- Per-face emotional analysis\n- Valence-arousal-intensity data\n- Audio and transcript emotion data\n- Personality analysis\n- Video Highlights\n- Optional psychological insights\n "
paths:
/v2/videos:
post:
tags:
- Video Emotion API
summary: Upload Video
description: 'Analyze emotions and facial expressions from video content.
Submit a video from multiple sources and receive detailed emotion analysis
of all detected faces throughout the video timeline.
**Input Sources:**
- **YouTube**: Provide any YouTube video URL
- **Cloud Storage**: Dropbox, Google Drive, or other cloud service links
- **Social Media**: Instagram, Facebook, Twitter (X) videos
- **Direct URL**: Any publicly accessible video link
- **File Upload**: Upload video files directly from your device
**Analyze Specific Segments:**
Focus on specific portions using `start_millis` and `end_millis` parameters.
This helps target key moments and optimize credit usage.
**How It Works:**
1. Submit your video and receive an immediate response with a video ID
2. Video is queued for processing (typically completes within minutes)
3. Optionally receive a webhook notification via `callback_url` when complete
4. Retrieve results using the video ID
**Supported Formats:**
MP4, AVI, MOV, WebM, MPEG
**Credit Usage:**
Processing time is billed based on the analyzed video duration.'
operationId: upload_video_v2_videos_post
requestBody:
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/Body_upload_video_v2_videos_post'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/VideoEmotionResponseV2'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- APIKeyHeader: []
/v1/videos:
get:
tags:
- Video Emotion API
summary: List Videos
description: Retrieves a paginated list of uploaded video files associated with the authenticated user.
operationId: list_videos_v1_videos_get
security:
- APIKeyHeader: []
parameters:
- name: offset_video_id
in: query
required: false
schema:
type: string
description: The ID of the reference video from which to paginate forward/backward
title: Offset Video Id
description: The ID of the reference video from which to paginate forward/backward
- name: page_size
in: query
required: false
schema:
type: integer
description: 'Number of results to return (default: 10)'
default: 10
title: Page Size
description: 'Number of results to return (default: 10)'
- name: direction
in: query
required: false
schema:
type: string
description: 'Pagination direction: forward (default) or backward'
default: forward
title: Direction
description: 'Pagination direction: forward (default) or backward'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}:
get:
tags:
- Video Emotion API
summary: Get Video Emotion Insights
description: Get a single video details by ID
operationId: get_video_emotion_insights_v1_videos__video_id__get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique ID of the video to be fetched
title: Video Id
description: The unique ID of the video to be fetched
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/VideoResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
delete:
tags:
- Video Emotion API
summary: Delete Video
description: Permanently deletes a video file and all associated emotional insights. This action is irreversible.
operationId: delete_video_v1_videos__video_id__delete
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique ID of the video to be deleted.
title: Video Id
description: The unique ID of the video to be deleted.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/VideoDeleteResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
put:
tags:
- Video Emotion API
summary: Reprocess Video
description: 'Reprocess an already uploaded and completed video file.
This is useful when insights need to be regenerated or logic has been updated on the backend.
Reprocessing can optionally notify your system via a callback URL.'
operationId: reprocess_video_v1_videos__video_id__put
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: Unique identifier of the video to reprocess
title: Video Id
description: Unique identifier of the video to reprocess
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Body_reprocess_video_v1_videos__video_id__put'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ReprocessVideoResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v2/videos/{video_id}/multimodal-analytics:
get:
tags:
- Video Emotion API
summary: Get Video Multimodal Insights
description: 'Get complete multimodal analytics for a video including:
- Video emotion analysis (face-by-face)
- Audio emotion analysis (speaker-by-speaker)
- Text sentiment analysis
- Detected faces and speakers
- Overall summaries'
operationId: get_video_multimodal_insights_v2_videos__video_id__multimodal_analytics_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique ID of the video
title: Video Id
description: The unique ID of the video
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/FullVideoAnalyticsResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v2/videos/{video_id}/emotions/average:
get:
tags:
- Video Emotion API
summary: Get Average Emotions
description: 'Calculate and retrieve average emotion scores for a video with optional face filtering.
This endpoint computes the average emotion percentages across all frames in a video.
When a face_id is provided, it calculates the average emotions for only that specific face.
**Behavior:**
- **Without face_id**: Returns overall average emotion score for entire video (all faces combined)
- **With face_id**: Calculates average emotion scores for the specified face
**Parameters:**
- `video_id`: Unique identifier for the video
- `face_id`: (Optional) Calculate average emotions for only this face ID
**Response:**
Returns emotion scores as percentages (values sum to 1.0):
- `angry`: Percentage of anger emotion
- `disgust`: Percentage of disgust emotion
- `fear`: Percentage of fear emotion
- `happy`: Percentage of happiness emotion
- `sad`: Percentage of sadness emotion
- `surprise`: Percentage of surprise emotion
- `neutral`: Percentage of neutral emotion
**Use Cases:**
- **Overall video analysis**: Understand the general emotional tone of the entire video
- **Individual tracking**: Track emotional patterns of specific people throughout the video
- **Comparative analysis**: Compare emotional profiles between different faces in the same video
**Example Usage:**
- Overall average: `GET /v2/videos/123/emotions/average`
- Face-specific: `GET /v2/videos/123/emotions/average?face_id=1`
**Note:** Face-specific calculations require the face to appear in at least one frame.'
operationId: get_average_emotions_v2_videos__video_id__emotions_average_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video for which average emotions are to be calculated
title: Video Id
description: The unique video ID of the video for which average emotions are to be calculated
- name: face_id
in: query
required: false
schema:
type: integer
description: Optional face ID to calculate average emotions for a specific face
title: Face Id
description: Optional face ID to calculate average emotions for a specific face
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/EmotionScores'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v2/videos/{video_id}/annotated_video:
get:
tags:
- Video Emotion API
summary: Get Annotated Video
description: "Get annotated video with emotion labels and bounding boxes overlaid on each frame.\n\n**How It Works:**\n- First request initiates video generation and returns a status response\n- Poll this endpoint to check generation progress\n- When ready, returns a secure signed URL for downloading the video\n\n**Response Types:**\n\n1. **Status Response** (JSON) - While generating:\n ```json\n {\n \"video_id\": \"abc123\",\n \"message\": \"Annotated video is currently being generated...\",\n \"status\": \"pending\"\n }\n ```\n\n2. **Signed URL Response** (JSON) - When complete:\n ```json\n {\n \"video_id\": \"abc123\",\n \"download_url\": \"https://storage.googleapis.com/...\",\n \"filename\": \"My_Video_abc123.mp4\",\n \"expires_in_minutes\": 60,\n \"expires_at\": \"2026-01-09T12:00:00Z\",\n \"note\": \"Download URL will expire. Request a new URL if expired.\"\n }\n ```\n\n**Parameters:**\n- `video_id`: Video identifier\n- `callback_url`: Optional webhook URL to receive notification when generation completes\n\n**Prerequisites:**\nVideo analysis must be complete before requesting annotated video.\n\n**Security:**\n- New videos are stored privately and require signed URLs for access\n- Signed URLs expire after 60 minutes for security\n- Old videos may use public URLs (backward compatibility)\n\n**Example Workflow:**\n\n```python\n# 1. Request annotated video (with optional callback URL)\nGET /v2/videos/abc123/annotated_video?callback_url=https://example.com/webhook\nResponse: {\"status\": \"pending\", \"message\": \"...\"}\n\n# 2. Check status (poll until ready)\nGET /v2/videos/abc123/annotated_video\nResponse: {\"status\": \"in progress\", \"message\": \"...\"}\n\n# 3. Get download URL when ready\nGET /v2/videos/abc123/annotated_video\nResponse: {\"video_id\": \"abc123\", \"download_url\": \"https://...\", ...}\n\n# 4. Download video from the signed URL\nGET <download_url>\n```"
operationId: get_annotated_video_v2_videos__video_id__annotated_video_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video
title: Video Id
description: The unique video ID of the video
- name: callback_url
in: query
required: false
schema:
type: string
description: Optional callback URL to notify when annotated video generation is complete
default: ''
title: Callback Url
description: Optional callback URL to notify when annotated video generation is complete
responses:
'200':
description: Successful Response
content:
application/json:
schema:
anyOf:
- $ref: '#/components/schemas/SignedDownloadUrlResponse'
- $ref: '#/components/schemas/AnnotatedVideoResponse'
title: Response Get Annotated Video V2 Videos Video Id Annotated Video Get
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/valence_arousal:
get:
tags:
- Video Emotion API
summary: Get Valence Arousal
description: Get emotion intensities of a video based on video_id
operationId: get_valence_arousal_v1_videos__video_id__valence_arousal_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video whose emotion intensity is to be fetched
title: Video Id
description: The unique video ID of the video whose emotion intensity is to be fetched
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ValenceArousalIntensity'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames:
get:
tags:
- Video Emotion API
summary: Get Multiple Frame
description: API to Retrieve Frames of the video based on video_id.
operationId: get_multiple_frame_v1_videos__video_id__frames_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video for which the frames to be fetched
title: Video Id
description: The unique video ID of the video for which the frames to be fetched
- name: start_frame
in: query
required: false
schema:
type: string
description: The frame number from which retrieval should begin. Defaults to the start of the video if not provided.
title: Start Frame
description: The frame number from which retrieval should begin. Defaults to the start of the video if not provided.
- name: length
in: query
required: false
schema:
type: string
description: The number of frames to retrieve, starting from 'start_frame'. If omitted, all available frames will be returned.
title: Length
description: The number of frames to retrieve, starting from 'start_frame'. If omitted, all available frames will be returned.
- name: face_ids
in: query
required: false
schema:
type: string
description: Optional comma-separated list of face IDs (e.g., '1,2,3')
default: ''
title: Face Ids
description: Optional comma-separated list of face IDs (e.g., '1,2,3')
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MultipleFramesResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames/{frame_id}:
get:
tags:
- Video Emotion API
summary: Get Single Frame
description: Get a unique frame details based on video_id and frame_id
operationId: get_single_frame_v1_videos__video_id__frames__frame_id__get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video for which the frame to be fetched.
title: Video Id
description: The unique video ID of the video for which the frame to be fetched.
- name: frame_id
in: path
required: true
schema:
type: string
description: The unique frame ID of the frame to be fetched.
title: Frame Id
description: The unique frame ID of the frame to be fetched.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/FramesResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames/{frame_id}/dominant_emotion:
get:
tags:
- Video Emotion API
summary: Retrieve Domination Emotion For A Specific Frame
description: 'This API endpoint is designed to fetch and return the dominant emotion of frames within a video based on its video_id.
If face_id is provided, the dominant emotion of a specific face will be the output.'
operationId: retrieve_domination_emotion_for_a_specific_frame_v1_videos__video_id__frames__frame_id__dominant_emotion_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: Unique identifier of the video from which the frame’s dominant emotion is to be fetched.
title: Video Id
description: Unique identifier of the video from which the frame’s dominant emotion is to be fetched.
- name: frame_id
in: path
required: true
schema:
type: string
description: The unique id of the frame from which the dominant emotion is to be fetched.
title: Frame Id
description: The unique id of the frame from which the dominant emotion is to be fetched.
- name: face_id
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: The id of the face whose dominant emotion is to be retrieved. If not provided, the dominant emotion for the entire frame will be returned.
title: Face Id
description: The id of the face whose dominant emotion is to be retrieved. If not provided, the dominant emotion for the entire frame will be returned.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/FrameEmotionResponseData'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames/{frame_id}/valence_arousal:
get:
tags:
- Video Emotion API
summary: Retrieve Emotion Intensity
description: Retrieve Emotion Intensity for a Specific Frame
operationId: retrieve_emotion_intensity_v1_videos__video_id__frames__frame_id__valence_arousal_get
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video for which the frame's valence, arousal, and intensity are to be fetched.
title: Video Id
description: The unique video ID of the video for which the frame's valence, arousal, and intensity are to be fetched.
- name: frame_id
in: path
required: true
schema:
type: string
description: The unique frame ID of the frame from which to fetch the valence, arousal, and intensity.
title: Frame Id
description: The unique frame ID of the frame from which to fetch the valence, arousal, and intensity.
- name: face_id
in: query
required: false
schema:
anyOf:
- type: string
- type: 'null'
description: The ID of the face whose valence, arousal, and intensity are to be retrieved. If not provided, these values for the entire frame will be returned.
title: Face Id
description: The ID of the face whose valence, arousal, and intensity are to be retrieved. If not provided, these values for the entire frame will be returned.
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/ValenceArousalIntensity'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames/{frame_id}/faces/{face_id}/emotions:
put:
tags:
- Video Emotion API
summary: Update Emotion Per Frame
description: Update the emotion of a specific face in a frame
operationId: update_emotion_per_frame_v1_videos__video_id__frames__frame_id__faces__face_id__emotions_put
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video.
title: Video Id
description: The unique video ID of the video.
- name: frame_id
in: path
required: true
schema:
type: string
description: The unique frame ID of the frame.
title: Frame Id
description: The unique frame ID of the frame.
- name: face_id
in: path
required: true
schema:
type: string
description: The unique face ID of the face in the frame.
title: Face Id
description: The unique face ID of the face in the frame.
requestBody:
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Body_update_emotion_per_frame_v1_videos__video_id__frames__frame_id__faces__face_id__emotions_put'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateEmotionResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames/{frame_id}/faces/{face_id}/note:
put:
tags:
- Video Emotion API
summary: Edit Face Note
description: Update the note associated with a detected face in a frame.
operationId: edit_face_note_v1_videos__video_id__frames__frame_id__faces__face_id__note_put
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video id of the video.
title: Video Id
description: The unique video id of the video.
- name: frame_id
in: path
required: true
schema:
type: string
description: The unique id of the frame inside the video.
title: Frame Id
description: The unique id of the frame inside the video.
- name: face_id
in: path
required: true
schema:
type: string
description: The unique id of the face inside the frame. Use '0' to add a note to the entire frame instead of a specific face.
title: Face Id
description: The unique id of the face inside the frame. Use '0' to add a note to the entire frame instead of a specific face.
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Body_edit_face_note_v1_videos__video_id__frames__frame_id__faces__face_id__note_put'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/FrameNoteResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/frames/faces:
put:
tags:
- Video Emotion API
summary: Update Multiple Faces
description: Update Face ID in multiple frames of a video
operationId: update_multiple_faces_v1_videos__video_id__frames_faces_put
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video in which face ID to be changed
title: Video Id
description: The unique video ID of the video in which face ID to be changed
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema:
$ref: '#/components/schemas/Body_update_multiple_faces_v1_videos__video_id__frames_faces_put'
responses:
'200':
description: Successful Response
content:
application/json:
schema:
$ref: '#/components/schemas/MultiFaceResponse'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/v1/videos/{video_id}/faces:
put:
tags:
- Video Emotion API
summary: Merge Face
description: Merge multiple face detections into a single face to remove duplicates from a video.
operationId: merge_face_v1_videos__video_id__faces_put
security:
- APIKeyHeader: []
parameters:
- name: video_id
in: path
required: true
schema:
type: string
description: The unique video ID of the video.
title: Video Id
description: The unique video ID of the video.
requestBody:
required: true
content:
application/x-www-form-ur
# --- truncated at 32 KB (100 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/imentiv-ai/refs/heads/main/openapi/imentiv-ai-video-emotion-api-api-openapi.yml