{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-communication-services/json-schema/microsoft-azure-communication-services-add-chat-participants-request-schema.json",
  "title": "AddChatParticipantsRequest",
  "description": "Participants to be added to the thread.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-communication-services-participants-api-openapi.yml#/components/schemas/AddChatParticipantsRequest",
  "required": [
    "participants"
  ],
  "type": "object",
  "properties": {
    "participants": {
      "description": "Participants to add to a chat thread.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChatParticipant"
      }
    }
  },
  "$defs": {
    "ChatParticipant": {
      "description": "A participant of the chat thread.",
      "required": [
        "communicationIdentifier"
      ],
      "type": "object",
      "properties": {
        "communicationIdentifier": {
          "$ref": "#/$defs/CommunicationIdentifierModel"
        },
        "displayName": {
          "description": "Display name for the chat participant.",
          "type": "string"
        },
        "shareHistoryTime": {
          "format": "date-time",
          "description": "Time from which the chat history is shared with the participant. The timestamp is in RFC3339 format: `yyyy-MM-ddTHH:mm:ssZ`.",
          "type": "string"
        },
        "metadata": {
          "description": "Contextual metadata for the chat participant. The metadata consists of name/value pairs. The total size of all metadata pairs can be up to 1KB in size.",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        }
      }
    },
    "CommonCommunicationIdentifierModel": {
      "description": "Identifies a participant in Azure Communication services. A participant is, for example, a phone number or an Azure communication user. This model is polymorphic: Apart from kind and rawId, at most one further property may be set which must match the kind enum value.",
      "type": "object",
      "properties": {
        "kind": {
          "$ref": "#/$defs/CommunicationIdentifierModelKind",
          "description": "The identifier kind. Only required in responses."
        },
        "rawId": {
          "type": "string",
          "description": "Raw Id of the identifier. Optional in requests, required in responses."
        },
        "communicationUser": {
          "$ref": "#/$defs/CommunicationUserIdentifierModel",
          "description": "The communication user."
        },
        "phoneNumber": {
          "$ref": "#/$defs/PhoneNumberIdentifierModel",
          "description": "The phone number."
        },
        "microsoftTeamsUser": {
          "$ref": "#/$defs/MicrosoftTeamsUserIdentifierModel",
          "description": "The Microsoft Teams user."
        },
        "microsoftTeamsApp": {
          "$ref": "#/$defs/MicrosoftTeamsAppIdentifierModel",
          "description": "The Microsoft Teams application."
        },
        "teamsExtensionUser": {
          "$ref": "#/$defs/TeamsExtensionUserIdentifierModel",
          "description": "The Microsoft Teams Extension user."
        }
      }
    },
    "CommonCommunicationUserIdentifierModel": {
      "description": "A user that got created with an Azure Communication Services resource.",
      "type": "object",
      "required": [
        "id"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The Id of the communication user."
        }
      }
    },
    "CommonMicrosoftTeamsAppIdentifierModel": {
      "description": "A Microsoft Teams application.",
      "type": "object",
      "required": [
        "appId"
      ],
      "properties": {
        "appId": {
          "type": "string",
          "description": "The Id of the Microsoft Teams application."
        },
        "cloud": {
          "$ref": "#/$defs/CommunicationCloudEnvironmentModel",
          "description": "The cloud that the Microsoft Teams application belongs to. By default 'public' if missing."
        }
      }
    },
    "CommonMicrosoftTeamsUserIdentifierModel": {
      "description": "A Microsoft Teams user.",
      "type": "object",
      "required": [
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "string",
          "description": "The Id of the Microsoft Teams user. If not anonymous, this is the Entra ID object Id of the user."
        },
        "isAnonymous": {
          "type": "boolean",
          "description": "True if the Microsoft Teams user is anonymous. By default false if missing."
        },
        "cloud": {
          "$ref": "#/$defs/CommunicationCloudEnvironmentModel",
          "description": "The cloud that the Microsoft Teams user belongs to. By default 'public' if missing."
        }
      }
    },
    "CommunicationCloudEnvironmentModel": {
      "description": "The cloud that the identifier belongs to.",
      "type": "string",
      "enum": [
        "public",
        "dod",
        "gcch"
      ],
      "x-ms-enum": {
        "name": "CommunicationCloudEnvironmentModel",
        "modelAsString": true
      }
    },
    "CommunicationIdentifierModel": {
      "$ref": "#/$defs/CommonCommunicationIdentifierModel"
    },
    "CommunicationUserIdentifierModel": {
      "$ref": "#/$defs/CommonCommunicationUserIdentifierModel"
    },
    "MicrosoftTeamsAppIdentifierModel": {
      "$ref": "#/$defs/CommonMicrosoftTeamsAppIdentifierModel"
    },
    "MicrosoftTeamsUserIdentifierModel": {
      "$ref": "#/$defs/CommonMicrosoftTeamsUserIdentifierModel"
    }
  }
}