{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/moments-lab/json-schema/moments-lab-moments-analysis-schema.json",
  "title": "MomentsAnalysis",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/moments-lab-openapi.yml#/components/schemas/MomentsAnalysis",
  "type": "object",
  "properties": {
    "media_description": {
      "type": "object",
      "propertyNames": {
        "type": "string"
      },
      "additionalProperties": {
        "type": "string"
      },
      "description": "Generated description of the media content in all translated languages depending on your workspace configuration "
    },
    "moments": {
      "description": "All moments found in the media including sequences, soundbites, moments",
      "type": "array",
      "items": {
        "$ref": "#/$defs/Moments"
      }
    },
    "tags": {
      "description": "Most accurate tags applied on the overall media including labels and persons",
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/$defs/Person"
          },
          {
            "$ref": "#/$defs/Label"
          }
        ]
      }
    },
    "external_id": {
      "description": "External id provided when analysis request sent",
      "type": "string"
    },
    "embeddings": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Embeddings"
      },
      "description": "Embeddings related to the media. Empty when they are served through `embeddings_url`"
    },
    "embeddings_url": {
      "description": "Temporary URL to a JSON file with all the embeddings of the media, its moments and its shots, described by the `EmbeddingsFile` schema. Moments and shots are matched to this analysis on their type and timestamps. When embeddings are served through this URL, the `embeddings` fields of the media, moments and shots are empty. If the URL is missing while these fields are empty, no embeddings are available for this response: the media has none, they are not enabled for the workspace, or they could not be exported this time. The URL is valid until `embeddings_url_expires_at`: fetch the analysis again to get a new one",
      "type": "string"
    },
    "embeddings_url_expires_at": {
      "format": "date-time",
      "description": "Expiration date of `embeddings_url`",
      "type": "string"
    }
  },
  "required": [
    "media_description",
    "embeddings"
  ],
  "$defs": {
    "Embeddings": {
      "type": "object",
      "properties": {
        "model_id": {
          "type": "string",
          "description": "Name of the model used to generate the embeddings as declared on hugging face"
        },
        "value": {
          "type": "array",
          "items": {
            "type": "number"
          },
          "description": "Vectors of the embeddings"
        }
      },
      "required": [
        "model_id",
        "value"
      ]
    },
    "Label": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "label"
          ],
          "description": "Type of the tag either "
        },
        "name": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "Description of the tag. Contains the description in all the language contained in the thesaurus"
        },
        "confidence": {
          "type": "number",
          "description": "Understand the accuracy of each detection with confidence scores."
        }
      },
      "required": [
        "id",
        "type",
        "name",
        "confidence"
      ]
    },
    "Moments": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "sequence",
            "moments",
            "soundbite"
          ],
          "description": "\n      Type : type : Type of moment. Possible values:\n      - \"sequence\": A sequence of shots or frames.\n      - \"moments\": General key moments in the media.\n      - \"soundbite\": A notable soundbite, with his speaker.\n    "
        },
        "tags": {
          "description": "Most accurate tags applied on the moment including labels and persons",
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/Person"
              },
              {
                "$ref": "#/$defs/Label"
              }
            ]
          }
        },
        "description": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "Generated description of the moment based on content."
        },
        "start_timestamp": {
          "type": "number",
          "description": "Starting time of the moment in seconds"
        },
        "end_timestamp": {
          "type": "number",
          "description": "Ending time of the moment in seconds"
        },
        "shots": {
          "description": "All shots included in this moment.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Shot"
          }
        },
        "speaker": {
          "description": "If the moment is a soundbite, provides information about the speaker.",
          "$ref": "#/$defs/Person"
        },
        "context": {
          "description": "When the moment is sound bite type, it gives more context when the sound bite was pronounced",
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          }
        },
        "embeddings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Embeddings"
          },
          "description": "Embeddings related to the moment. Empty when they are served through `mxt_analysis.embeddings_url`"
        }
      },
      "required": [
        "type",
        "description",
        "start_timestamp",
        "end_timestamp",
        "embeddings"
      ]
    },
    "Person": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "enum": [
            "person"
          ],
          "description": "Type of the tag either "
        },
        "name": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "Description of the tag. Contains the description in all the language contained in the thesaurus"
        },
        "confidence": {
          "type": "number",
          "description": "Understand the accuracy of each detection with confidence scores."
        }
      },
      "required": [
        "id",
        "type",
        "name",
        "confidence"
      ]
    },
    "Shot": {
      "type": "object",
      "properties": {
        "tags": {
          "description": "Most accurate tags applied on the shot including labels and persons",
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/Person"
              },
              {
                "$ref": "#/$defs/Label"
              }
            ]
          }
        },
        "start_timestamp": {
          "type": "number",
          "description": "Value in seconds when this occurrence started."
        },
        "end_timestamp": {
          "type": "number",
          "description": "Value in seconds when this occurrence ended."
        },
        "description": {
          "type": "object",
          "propertyNames": {
            "type": "string"
          },
          "additionalProperties": {
            "type": "string"
          },
          "description": "Generated description of the shot based on content."
        },
        "embeddings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Embeddings"
          },
          "description": "Embeddings related to the shot. Empty when they are served through `mxt_analysis.embeddings_url`"
        }
      },
      "required": [
        "start_timestamp",
        "end_timestamp",
        "description",
        "embeddings"
      ]
    }
  }
}