{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-start-call-recording-request-schema.json",
  "title": "StartCallRecordingRequest",
  "description": "The request payload start for call recording operation with call locator.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-communication-services-callautomation-api-openapi.yml#/components/schemas/StartCallRecordingRequest",
  "type": "object",
  "properties": {
    "callLocator": {
      "$ref": "#/$defs/CallLocator"
    },
    "callConnectionId": {
      "description": "The call connection Id. (Only one of callLocator or callConnectionId to be used)",
      "type": "string"
    },
    "recordingStateCallbackUri": {
      "description": "The uri to send notifications to.",
      "type": "string"
    },
    "recordingContentType": {
      "$ref": "#/$defs/RecordingContentType"
    },
    "recordingChannelType": {
      "$ref": "#/$defs/RecordingChannelType"
    },
    "recordingFormatType": {
      "$ref": "#/$defs/RecordingFormatType"
    },
    "audioChannelParticipantOrdering": {
      "description": "The sequential order in which audio channels are assigned to participants in the unmixed recording.\r\nWhen 'recordingChannelType' is set to 'unmixed' and `audioChannelParticipantOrdering is not specified,\r\nthe audio channel to participant mapping will be automatically assigned based on the order in which participant\r\nfirst audio was detected.  Channel to participant mapping details can be found in the metadata of the recording.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/CommunicationIdentifierModel"
      }
    },
    "channelAffinity": {
      "description": "The channel affinity of call recording\r\nWhen 'recordingChannelType' is set to 'unmixed', if channelAffinity is not specified, 'channel' will be automatically assigned.\r\nChannel-Participant mapping details can be found in the metadata of the recording.\r\n///",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChannelAffinity"
      }
    },
    "pauseOnStart": {
      "description": "When set to true will start recording in Pause mode, which can be resumed.",
      "type": "boolean"
    },
    "externalStorage": {
      "$ref": "#/$defs/ExternalStorage"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "CallLocator": {
      "description": "The locator used for joining or taking action on a call",
      "type": "object",
      "properties": {
        "groupCallId": {
          "description": "The group call id",
          "type": "string"
        },
        "serverCallId": {
          "description": "The server call id.",
          "type": "string"
        },
        "roomId": {
          "description": "The Acs room id. (Not supported for Start Recording)",
          "type": "string"
        },
        "kind": {
          "$ref": "#/$defs/CallLocatorKind"
        }
      },
      "additionalProperties": false
    },
    "CallLocatorKind": {
      "description": "The call locator kind",
      "enum": [
        "groupCallLocator",
        "serverCallLocator",
        "roomCallLocator"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "CallLocatorKind",
        "modelAsString": true
      }
    },
    "ChannelAffinity": {
      "description": "Channel affinity for a participant",
      "required": [
        "participant"
      ],
      "type": "object",
      "properties": {
        "channel": {
          "format": "int32",
          "description": "Channel number to which bitstream from a particular participant will be written.",
          "maximum": 4,
          "minimum": 0,
          "type": "integer"
        },
        "participant": {
          "$ref": "#/$defs/CommunicationIdentifierModel"
        }
      },
      "additionalProperties": false
    },
    "CommunicationIdentifierModel": {
      "$ref": "../../../Common/stable/2025-06-30/common.json#/components/schemas/CommunicationIdentifierModel"
    },
    "ExternalStorage": {
      "required": [
        "recordingStorageKind"
      ],
      "type": "object",
      "properties": {
        "recordingStorageKind": {
          "$ref": "#/$defs/RecordingStorageKind"
        },
        "recordingDestinationContainerUrl": {
          "format": "uri",
          "description": "Uri of a container or a location within a container",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "RecordingChannelType": {
      "description": "Defines the channel type of call recording.",
      "enum": [
        "mixed",
        "unmixed"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "RecordingChannelType",
        "modelAsString": true
      }
    },
    "RecordingContentType": {
      "description": "The content type of call recording.",
      "enum": [
        "audio",
        "audioVideo"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "RecordingContentType",
        "modelAsString": true
      }
    },
    "RecordingFormatType": {
      "description": "Defines the format type of call recording.",
      "enum": [
        "wav",
        "mp3",
        "mp4"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "RecordingFormatType",
        "modelAsString": true
      }
    },
    "RecordingStorageKind": {
      "description": "Defines the kind of external storage",
      "enum": [
        "azureCommunicationServices",
        "azureBlobStorage"
      ],
      "type": "string",
      "x-ms-enum": {
        "name": "RecordingStorageKind",
        "modelAsString": true
      }
    }
  }
}