{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-kendra/json-schema/amazon-kendra-put-principal-mapping-request-schema.json",
  "title": "PutPrincipalMappingRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-kendra-principal-mapping-api-openapi.yml#/components/schemas/PutPrincipalMappingRequest",
  "type": "object",
  "properties": {
    "IndexId": {
      "type": "string",
      "description": "The identifier of the index you want to map users to their groups."
    },
    "DataSourceId": {
      "type": "string",
      "description": "The identifier of the data source 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."
    },
    "GroupId": {
      "type": "string",
      "description": "The identifier of the group you want to map its users to."
    },
    "GroupMembers": {
      "$ref": "#/$defs/GroupMembers"
    },
    "OrderingId": {
      "type": "integer",
      "description": "The timestamp identifier you specify to ensure Amazon Kendra doesn't override the latest PUT action with previous actions. The highest number ID, which is the ordering ID, is the latest action you want to process and apply on top of other actions with lower number IDs. This prevents previous actions with lower number IDs from possibly overriding the latest action. The ordering ID can be the Unix time of the last update you made to a group members list. You would then provide this list when calling PutPrincipalMapping. This ensures your PUT action for that updated group with the latest members "
    },
    "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. For more information, see IAM roles for Amazon Kendra."
    }
  },
  "required": [
    "IndexId",
    "GroupId",
    "GroupMembers"
  ],
  "$defs": {
    "GroupMembers": {
      "type": "object",
      "properties": {
        "MemberGroups": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MemberGroup"
          },
          "description": "A list of users that belong to a group. This can also include sub groups. For example, the sub groups \"Research\", \"Engineering\", and \"Sales and Marketing\" all belong to the group \"Company A\"."
        },
        "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/S3Path"
        }
      }
    },
    "MemberGroup": {
      "type": "object",
      "properties": {
        "GroupId": {
          "type": "string",
          "description": "The identifier of the sub group you want to map to a group."
        },
        "DataSourceId": {
          "type": "string",
          "description": "The identifier of the data source for the sub group you want to map to a group."
        }
      },
      "required": [
        "GroupId"
      ]
    },
    "MemberUser": {
      "type": "object",
      "properties": {
        "UserId": {
          "type": "string",
          "description": "The identifier of the user you want to map to a group."
        }
      },
      "required": [
        "UserId"
      ]
    },
    "S3Path": {
      "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"
      ]
    }
  }
}