{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-q/json-schema/amazon-q-put-group-request-schema.json",
  "title": "PutGroupRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-q-groups-api-openapi.yml#/components/schemas/PutGroupRequest",
  "type": "object",
  "properties": {
    "applicationId": {
      "type": "string",
      "description": "The identifier of the application in which the user and group mapping belongs."
    },
    "indexId": {
      "type": "string",
      "description": "The identifier of the index in which you want to map users to their groups."
    },
    "groupName": {
      "type": "string",
      "description": "The list that contains your users or sub groups that belong the same group. For example, the group \"Company\" includes the user \"CEO\" and the sub groups \"Research\", \"Engineering\", and \"Sales and Marketing\"."
    },
    "dataSourceId": {
      "type": "string",
      "description": "The identifier of the data source for which you want to map users to their groups. This is useful if a group is tied to multiple data sources, but you only want the group to access documents of a certain data source. For example, the groups \"Research\", \"Engineering\", and \"Sales and Marketing\" are all tied to the company's documents stored in the data sources Confluence and Salesforce. However, \"Sales and Marketing\" team only needs access to customer-related documents stored in Salesforce."
    },
    "type": {
      "type": "string",
      "enum": [
        "INDEX",
        "DATASOURCE"
      ],
      "description": "The type of the group."
    },
    "groupMembers": {
      "$ref": "#/$defs/GroupMembers"
    },
    "roleArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of an IAM role that has access to the S3 file that contains your list of users that belong to a group."
    }
  },
  "required": [
    "applicationId",
    "indexId",
    "groupName",
    "type",
    "groupMembers"
  ],
  "$defs": {
    "GroupMembers": {
      "type": "object",
      "properties": {
        "memberGroups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MemberGroup"
          },
          "description": "A list of sub groups that belong to a group. For example, the sub groups \"Research\", \"Engineering\", and \"Sales and Marketing\" all belong to the group \"Company\"."
        },
        "memberUsers": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MemberUser"
          },
          "description": "A list of users that belong to a group. For example, a list of interns all belong to the \"Interns\" group."
        },
        "s3PathForGroupMembers": {
          "$ref": "#/$defs/S3"
        }
      }
    },
    "MemberGroup": {
      "type": "object",
      "properties": {
        "groupName": {
          "type": "string",
          "description": "The name of the sub group."
        },
        "type": {
          "type": "string",
          "enum": [
            "INDEX",
            "DATASOURCE"
          ],
          "description": "The type of the sub group."
        }
      },
      "required": [
        "groupName"
      ]
    },
    "MemberUser": {
      "type": "object",
      "properties": {
        "userId": {
          "type": "string",
          "description": "The identifier of the user you want to map to a group."
        },
        "type": {
          "type": "string",
          "enum": [
            "INDEX",
            "DATASOURCE"
          ],
          "description": "The type of the user."
        }
      },
      "required": [
        "userId"
      ]
    },
    "S3": {
      "type": "object",
      "properties": {
        "bucket": {
          "type": "string",
          "description": "The name of the S3 bucket that contains the file."
        },
        "key": {
          "type": "string",
          "description": "The name of the file."
        }
      },
      "required": [
        "bucket",
        "key"
      ]
    }
  }
}