{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/valossa-com/json-schema/valossa-com-finalize-file-upload-response-schema.json",
  "title": "FinalizeFileUploadResponse",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/valossa-com-openapi.yaml#/components/schemas/FinalizeFileUploadResponse",
  "type": "object",
  "properties": {
    "uploaded_file_url": {
      "type": "string"
    },
    "job_info": {
      "type": "object",
      "properties": {
        "job_id": {
          "type": "string",
          "format": "uuid"
        },
        "request": {
          "type": "object"
        }
      }
    },
    "media_info": {
      "type": "object",
      "properties": {
        "technical": {
          "type": "object",
          "properties": {
            "duration_s": {
              "type": "number"
            },
            "fps": {
              "type": "number"
            }
          }
        },
        "from_customer": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string"
            }
          }
        }
      }
    },
    "detections": {
      "type": "object",
      "description": "Associative array keyed by detection ID (string). Each value is a detection\nwith at minimum `t` (type) and `label` fields.\n",
      "additionalProperties": {
        "$ref": "#/$defs/Detection"
      }
    },
    "detection_groupings": {
      "type": "object",
      "properties": {
        "by_detection_type": {
          "type": "object",
          "description": "Detection IDs grouped by detection type, sorted by relevance",
          "additionalProperties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "by_second": {
          "type": "array",
          "description": "Per-second index of detections present at each second of video, optionally including per-second confidence and type-specific attributes",
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "d": {
                  "type": "string",
                  "description": "Detection ID"
                },
                "c": {
                  "type": "number",
                  "description": "Confidence at this second when the detection type exposes per-second confidence"
                },
                "o": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "Occurrence IDs active at this second"
                },
                "a": {
                  "type": "object",
                  "description": "Per-second attributes for supported detection types.\n- `human.face`: `sen` (facial valence + ranked `emo` array) and `sz`\n- `audio.voice_emotion`: `val` and `aro`\n- `visual.color`: `rgb` array of `{v, f}` color items\n"
                }
              }
            }
          }
        }
      }
    },
    "segmentations": {
      "type": "object",
      "description": "Shot boundary detection data"
    }
  },
  "$defs": {
    "Detection": {
      "type": "object",
      "required": [
        "t",
        "label"
      ],
      "properties": {
        "t": {
          "type": "string",
          "description": "Detection type identifier (e.g. visual.context, human.face)"
        },
        "label": {
          "type": "string",
          "description": "Human-readable label for the detected concept"
        },
        "cid": {
          "type": "string",
          "description": "Valossa Concept ID (present on visual.context and audio.context)"
        },
        "ext_refs": {
          "type": "object",
          "description": "References to external ontologies (Wikidata, GKG, IAB)",
          "properties": {
            "wikidata": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                }
              }
            },
            "gkg": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                }
              }
            },
            "iab": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "labels_hierarchy": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "categ": {
          "type": "object",
          "description": "Category tags for this detection (e.g. content_compliance, violence)"
        },
        "a": {
          "type": "object",
          "description": "Additional attributes, detection-type specific.\nFor human.face: gender, similar_to, quality, s_visible.\nFor audio.speech: sen (sentiment/valence).\nPer-second attributes are documented separately in `detection_groupings.by_second`.\n"
        },
        "occs": {
          "type": "array",
          "description": "Time ranges where this detection appears in the video",
          "items": {
            "$ref": "#/$defs/Occurrence"
          }
        }
      }
    },
    "Occurrence": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Occurrence ID (string)"
        },
        "ss": {
          "type": "number",
          "description": "Start second (relative to video start)"
        },
        "se": {
          "type": "number",
          "description": "End second"
        },
        "c_max": {
          "type": "number",
          "description": "Maximum confidence during this occurrence (visual.context and audio.context only)"
        },
        "c": {
          "type": "number",
          "description": "Confidence for this occurrence (topic.iab.section only)"
        },
        "shs": {
          "type": "integer",
          "description": "Shot index where occurrence starts"
        },
        "she": {
          "type": "integer",
          "description": "Shot index where occurrence ends"
        }
      }
    }
  }
}