Score a container
The Aive API allows you to score an analyzed container against a scoring template.
A scoring template defines a set of rules that represent the characteristics of a successful video for a specific social media platform or use case. The resulting score indicates how closely the analyzed container matches those rules.
Scoring is a synchronous operation and is only available for containers that have already been analyzed.
Note: You can only score an uploaded and analyzed video container through this. Not an unrendered montage nor an exported rendition.
Prerequisites
Before scoring a container, ensure that:
- The container exists.
- The container analysis has completed successfully.
- The container has been analyzed with a minimum
manifestLevelofL. - The container contains at least one video stream.
- You know the ID of your workspace.
- You know the ID of the scoring template you want to use.
Containers analyzed with manifestLevel values S or M cannot be scored because they do not contain enough extracted information. L is the minimum required level, but the score is computed from the analysis results, so it is only as relevant as the information available — analyzing with manifestLevel: XL is recommended for the most relevant score. See Analyse a container for how to choose the analysis level.
Step 1 - Get your workspace ID
To retrieve the available scoring templates, you first need your workspace ID.
The public API doesn't list your workspaces yet, so retrieve the workspace ID from the Aive web application:
- Open your workspace in Aive.
- Copy the workspace identifier from the URL.
For example, if the URL is:
https://app.aive.com/w/workspace/<workspace_id>then:
<workspace_id>is the unique identifier of your workspace.
Use this value when querying the available scoring templates.
Step 2 - List available scoring templates
Each workspace has access to a list of scoring templates.
A scoring template defines the set of rules used to evaluate a container. Aive provides built-in templates, and additional custom templates can be created from the Aive web application.
Templates query
query Templates($workspaceID: ID!) {
workspace(id: $workspaceID) {
suggestionTemplates {
id
name
description
}
}
}Templates variables
{
"workspaceID": "<workspace_id>"
}Templates response
{
"data": {
"workspace": {
"suggestionTemplates": [
{
"id": "<template_id>",
"name": "Instagram Reel",
"description": "<template_description>"
}
]
}
}
}Choose the template that best matches your target platform or use case and keep its id for the next step.
Step 3 - Score a container
Use the scoreContainer mutation to evaluate an analyzed container against a scoring template.
ScoreContainer mutation
mutation ScoreContainer($input: ScoreContainerInput!) {
scoreContainer(input: $input) {
... on ScoreContainerResult {
score
}
... on ScoreContainerError {
code
message
}
}
}ScoreContainer variables
{
"input": {
"containerId": "<container_id>",
"templateId": "<template_id>"
}
}ScoreContainer response
{
"data": {
"scoreContainer": {
"score": 0.87
}
}
}The scoring operation is synchronous, meaning the score is returned immediately in the response.
Understanding the score
The returned score is a floating-point value between 0.0 and 1.0.
0.0indicates that the container matches very few of the rules defined by the selected template.1.0indicates that the container closely matches the rules defined by the selected template.
The score is a global indicator of how well the analyzed container aligns with the selected scoring template. Higher scores indicate a better match.
Retry behavior
A container can be scored multiple times. For example, you may:
- score the same container using different templates;
- score it again after updating or replacing a scoring template.
Each scoring request is processed independently.
Errors
| Error code | Description |
|---|---|
containerNotFound | The specified container does not exist. |
containerNotAnalyzed | The container has not been analyzed yet or does not have the required analysis level. |
missingVideoStream | The container does not contain any video stream. |
templateNotFound | The specified scoring template does not exist. |
See Error handling for how these typed errors are returned.
Best practices
- Ensure that the container analysis has completed successfully before scoring — see Event handling for how to know when it does.
- Analyze containers with
manifestLevel: Lat minimum before requesting a score, but prefermanifestLevel: XLfor the most relevant score, since it is computed from the analysis results. - Make sure the container contains a video stream.
- Select the scoring template that best matches your target platform or content strategy.
- Reuse the same analyzed container to compare scores across different templates.
- Treat the score as a decision-support indicator rather than an absolute measure of content quality.

