Skip to content

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 manifestLevel of L.
  • 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:

  1. Open your workspace in Aive.
  2. Copy the workspace identifier from the URL.

For example, if the URL is:

text
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 ​

graphql
query Templates($workspaceID: ID!) {
  workspace(id: $workspaceID) {
    suggestionTemplates {
      id
      name
      description
    }
  }
}

Templates variables ​

json
{
  "workspaceID": "<workspace_id>"
}

Templates response ​

json
{
  "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 ​

graphql
mutation ScoreContainer($input: ScoreContainerInput!) {
  scoreContainer(input: $input) {
    ... on ScoreContainerResult {
      score
    }
    ... on ScoreContainerError {
      code
      message
    }
  }
}

ScoreContainer variables ​

json
{
  "input": {
    "containerId": "<container_id>",
    "templateId": "<template_id>"
  }
}

ScoreContainer response ​

json
{
  "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.0 indicates that the container matches very few of the rules defined by the selected template.
  • 1.0 indicates 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 codeDescription
containerNotFoundThe specified container does not exist.
containerNotAnalyzedThe container has not been analyzed yet or does not have the required analysis level.
missingVideoStreamThe container does not contain any video stream.
templateNotFoundThe 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: L at minimum before requesting a score, but prefer manifestLevel: XL for 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.