{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/moments-lab/json-schema/moments-lab-creation-recording-request-schema.json",
  "title": "CreationRecordingRequest",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/moments-lab-openapi.yml#/components/schemas/CreationRecordingRequest",
  "type": "object",
  "properties": {
    "device_uids": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of devices uids to record from"
    },
    "title": {
      "type": "string",
      "description": "Name of the recording"
    },
    "event": {
      "description": "Event parameters to create it. If not provided, a new event will be created.",
      "$ref": "#/$defs/EventRecordingRequest"
    },
    "analysis_parameters": {
      "description": "Parameters to setup the analysis tasks you want to apply on the media",
      "$ref": "#/$defs/RecordingAnalysisParametersRequest"
    },
    "start_date": {
      "type": "string",
      "format": "date-time",
      "description": "Start of the recording. The actual start date will start within 1 minute compare to this date. This date cannot be in the past."
    },
    "end_date": {
      "type": "string",
      "format": "date-time",
      "description": "End of the recording."
    },
    "organisation_uids": {
      "description": "Organisation to link on the medias created by this recording",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "metadata": {
      "description": "Custom metadata to apply on the medias created by this recording",
      "type": "array",
      "items": {
        "$ref": "#/$defs/MetadataParametersRequest"
      }
    }
  },
  "required": [
    "device_uids",
    "title",
    "event",
    "analysis_parameters",
    "start_date",
    "end_date"
  ],
  "$defs": {
    "CreationEventRecordingParametersRequest": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "description": "The title of the event"
        },
        "program_uid": {
          "description": "The program to apply on the event",
          "type": "string"
        },
        "organisation_uids": {
          "description": "Organisation to link to the event, if not provided organisation will be the one linked to the api token",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "metadata": {
          "description": "Custom metadata to apply on the event",
          "type": "array",
          "items": {
            "$ref": "#/$defs/MetadataParametersRequest"
          }
        }
      },
      "required": [
        "title"
      ]
    },
    "EventRecordingRequest": {
      "type": "object",
      "properties": {
        "event_parameters": {
          "description": "Parameters to create event the media will be attached to",
          "$ref": "#/$defs/CreationEventRecordingParametersRequest"
        }
      }
    },
    "MetadataParametersRequest": {
      "type": "object",
      "properties": {
        "field_uid": {
          "type": "string",
          "description": "Unique identifier of the metadata field"
        },
        "value": {
          "type": "string",
          "description": "Value of the metadata"
        }
      },
      "required": [
        "field_uid",
        "value"
      ]
    },
    "RecordingAnalysisParametersRequest": {
      "type": "object",
      "properties": {
        "transcript_language": {
          "description": "Language in which the transcript will be generated, use <a href=\"https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes\">ISO 639-1 Code format</a>, no value will result in auto-detection of the language.<br/>Notice that specifying a language will fasten the analysis",
          "type": "string",
          "enum": [
            "af",
            "am",
            "ar",
            "as",
            "az",
            "ba",
            "be",
            "bg",
            "bn",
            "bo",
            "br",
            "bs",
            "ca",
            "cs",
            "cy",
            "da",
            "de",
            "el",
            "en",
            "es",
            "et",
            "eu",
            "fa",
            "fi",
            "fo",
            "fr",
            "gl",
            "gu",
            "ha",
            "haw",
            "he",
            "hi",
            "hr",
            "ht",
            "hu",
            "hy",
            "id",
            "is",
            "it",
            "ja",
            "jw",
            "ka",
            "kk",
            "km",
            "kn",
            "ko",
            "la",
            "lb",
            "ln",
            "lo",
            "lt",
            "lv",
            "mg",
            "mi",
            "mk",
            "ml",
            "mn",
            "mr",
            "ms",
            "mt",
            "my",
            "ne",
            "nl",
            "nn",
            "no",
            "oc",
            "pa",
            "pl",
            "ps",
            "pt",
            "ro",
            "ru",
            "sa",
            "sd",
            "si",
            "sk",
            "sl",
            "sn",
            "so",
            "sq",
            "sr",
            "su",
            "sv",
            "sw",
            "ta",
            "te",
            "tg",
            "th",
            "tk",
            "tl",
            "tr",
            "tt",
            "uk",
            "ur",
            "uz",
            "vi",
            "yi",
            "yo",
            "zh",
            "yue"
          ]
        },
        "audio_channel_mapping": {
          "description": "Audio channel mapping configuration for analysis when audio contains multiple tracks and channels. Each object specifies a track number and the channels to use from that track.Left empty to default value which is a downmix of all tracks and channels.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/RecordingAudioChannelMappingRequest"
          }
        },
        "tasks": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "mxt",
              "person_detection",
              "text_recognition"
            ]
          },
          "description": "Tasks will be applied on the live feeds"
        }
      },
      "required": [
        "tasks"
      ]
    },
    "RecordingAudioChannelMappingRequest": {
      "type": "object",
      "properties": {
        "track": {
          "type": "number"
        },
        "channels": {
          "type": "array",
          "items": {
            "type": "number"
          }
        }
      },
      "required": [
        "track",
        "channels"
      ]
    }
  }
}