> ## Documentation Index
> Fetch the complete documentation index at: https://developer.onetrust.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Add Data Subjects to Parent Consent Group

Use this API to add data subjects as children of the specified Parent Consent Group.

> 🗒 Things to Know
> 
> - A Parent Consent Group can either have Consent Groups as children or data subjects as children within a given level in the hierarchy, not both. If data subjects are added as children to the Parent Consent Group, Consent Groups cannot be added to the Parent Consent Group at that given level or any level below in the hierarchical structure.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Consent & Preferences - Universal Consent & Preference Management (OAS)",
    "version": "1.0",
    "contact": {
      "name": "OneTrust Support",
      "url": "https://my.onetrust.com/s/contactsupport"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "description": "The Universal Consent & Preference Management APIs are used to integrate external systems and streamline the flow of data with Universal Consent & Preference Management in the OneTrust Platform."
  },
  "servers": [
    {
      "url": "https://{hostname}",
      "variables": {
        "hostname": {
          "default": "hostname",
          "description": "The OneTrust hostname such as app.onetrust.com, app-eu.onetrust.com, app-de.onetrust.com, app-uk.onetrust.com, app-apac.onetrust.com, trial.onetrust.com, or uat.onetrust.com."
        }
      }
    }
  ],
  "tags": [
    {
      "name": "Consent Groups",
      "description": "APIs for managing Consent Groups and their configurations.",
      "externalDocs": {
        "description": "OpenAPI 3.1.0 - Download Definition",
        "url": "https://developer.onetrust.com/onetrust/openapi/consent-preferences-universal-consent-preference-management-oas.json"
      },
      "x-displayName": "Consent Groups"
    }
  ],
  "paths": {
    "/api/consent/v2/consent-groups/{consentGroupGuid}/data-subjects": {
      "post": {
        "operationId": "addDataSubjectsToConsentGroupUsingPOST",
        "summary": "Add Data Subjects to Parent Consent Group",
        "description": "Use this API to add data subjects as children of the specified Parent Consent Group.\n\n> 🗒 Things to Know\n> \n> - A Parent Consent Group can either have Consent Groups as children or data subjects as children within a given level in the hierarchy, not both. If data subjects are added as children to the Parent Consent Group, Consent Groups cannot be added to the Parent Consent Group at that given level or any level below in the hierarchical structure.",
        "tags": [
          "Consent Groups"
        ],
        "x-onetrust": {
          "spec-label": "https://developer.onetrust.com/onetrust/openapi/consent-preferences-universal-consent-preference-management-oas.json"
        },
        "parameters": [
          {
            "name": "consentGroupGuid",
            "in": "path",
            "description": "The UUID of the Consent Group. `consentGroupGuid` can be retrieved using the [Get a paged view for consent groups API](/onetrust/reference/getconsentgrouplistusingget)",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "1a6c1e65-aa4f-4d79-ac62-7fe905616f71"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentAPI_ConsentGroupDataSubjectsRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Data Subjects added to Consent Group successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConsentAPI_ConsentGroupDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request"
          },
          "401": {
            "description": "Unauthorized"
          },
          "403": {
            "description": "Forbidden"
          },
          "429": {
            "description": "Too Many Requests. \nFor more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).",
            "headers": {
              "Retry-After": {
                "schema": {
                  "description": "The number of seconds after which requests will be allowed again.",
                  "format": "int32"
                }
              },
              "ot-period": {
                "schema": {
                  "description": "The unit of time for which the rate limit applies",
                  "enum": [
                    "HOUR",
                    "MINUTE"
                  ]
                }
              },
              "ot-ratelimit-event-id": {
                "schema": {
                  "description": "The unique identifier for the rate-limiting event.",
                  "format": "uuid"
                }
              },
              "ot-request-made": {
                "schema": {
                  "description": "The number of requests made within the specified period.",
                  "format": "int32"
                }
              },
              "ot-requests-allowed": {
                "schema": {
                  "description": "The number of requests allowed within the specified period.",
                  "format": "int32"
                }
              }
            }
          },
          "500": {
            "description": "Internal Server Error"
          }
        },
        "security": [
          {
            "ConsentAPI_OAUTH2": [
              "CONSENT"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ConsentAPI_ConsentGroupDto": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The Consent Group name",
            "type": "string",
            "example": "OneTrust Atlanta",
            "minLength": 1
          },
          "description": {
            "description": "A description of the Consent Group",
            "type": "string",
            "example": "Consent for the company OneTrust, specifically for the Atlanta Office. Contains subsidiary data subjects representing OneTrust employees that work at this location."
          },
          "externalName": {
            "description": "The Consent Group's external name. If not provided, this will be generated based on the name",
            "type": "string",
            "example": "onetrust_atlanta"
          },
          "consentGroupId": {
            "description": "Unique identifier identifying a Consent Group",
            "type": "string",
            "format": "uuid",
            "example": "2a644966-fe93-4561-b71a-f0dda4396459"
          },
          "membershipType": {
            "description": "Indicates whether the consent group has other consent groups as its children, or if it has data subjects associated to it",
            "type": "string",
            "example": "CHILD_GROUPS",
            "enum": [
              "EMPTY",
              "CHILD_GROUPS",
              "DATA_SUBJECTS"
            ]
          },
          "purposeRules": {
            "description": "The Consent Group's Purpose Rules",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentAPI_PurposeRuleDto"
            }
          },
          "dataSubjects": {
            "description": "The Consent Group's Data Subjects",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentAPI_DataSubjectInformationDto"
            }
          },
          "consentGroups": {
            "description": "Consent Groups that are children of the current Consent Group",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentAPI_ConsentGroupSummaryDto"
            }
          }
        }
      },
      "ConsentAPI_ConsentGroupSummaryDto": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The Consent Group name",
            "type": "string",
            "example": "OneTrust Atlanta",
            "minLength": 1
          },
          "description": {
            "description": "A description of the Consent Group",
            "type": "string",
            "example": "Consent for the company OneTrust, specifically for the Atlanta Office. Contains subsidiary data subjects representing OneTrust employees that work at this location."
          },
          "externalName": {
            "description": "The Consent Group's external name. If not provided, this will be generated based on the name",
            "type": "string",
            "example": "onetrust_atlanta"
          },
          "consentGroupId": {
            "description": "Unique identifier identifying a Consent Group",
            "type": "string",
            "format": "uuid",
            "example": "2a644966-fe93-4561-b71a-f0dda4396459"
          },
          "membershipType": {
            "description": "Indicates whether the consent group has other consent groups as its children, or if it has data subjects associated to it",
            "type": "string",
            "example": "CHILD_GROUPS",
            "enum": [
              "EMPTY",
              "CHILD_GROUPS",
              "DATA_SUBJECTS"
            ]
          }
        }
      },
      "ConsentAPI_DataSubjectInformationDto": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique Identifier identifying a Data Subject",
            "type": "string",
            "format": "uuid",
            "example": "633ba071-61b0-485f-81a0-a2245777b432"
          },
          "identifier": {
            "description": "The Data Subject identifier value",
            "type": "string",
            "example": "example@otprivacy.com"
          },
          "purposes": {
            "description": "The Data Subject's Purpose list",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentAPI_DataSubjectPurposeInformationDto"
            }
          }
        }
      },
      "ConsentAPI_DataSubjectPurposeInformationDto": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Identifier identifying a Purpose",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "version": {
            "description": "The Purpose's version",
            "type": "integer",
            "format": "int64",
            "example": 2
          },
          "status": {
            "description": "The Data Subject's actual consent status for this Purpose",
            "type": "string",
            "example": "ACTIVE"
          },
          "effectiveStatus": {
            "description": "The Data Subject's effective status for this Purpose, in the context of the specified Consent Group",
            "type": "string",
            "example": "OPT_OUT"
          }
        }
      },
      "ConsentAPI_PurposeRuleDto": {
        "type": "object",
        "properties": {
          "purposeId": {
            "description": "Identifier identifying a Purpose",
            "type": "string",
            "format": "uuid",
            "example": "f2229953-b4b5-4042-8cb9-b78038cc4c46"
          },
          "enforcedStatus": {
            "description": "The Transaction Status enforced by the Consent Group for this Purpose",
            "type": "string",
            "example": "ACTIVE",
            "minLength": 1
          },
          "effectiveStatus": {
            "description": "The Consent Group's effective Transaction Status for this Purpose, which is calculated based on the Consent Group hierarchy",
            "type": "string",
            "example": "OPT_OUT"
          }
        },
        "required": [
          "purposeId"
        ]
      },
      "ConsentAPI_ConsentGroupDataSubjectsRequest": {
        "type": "object",
        "properties": {
          "dataSubjects": {
            "description": "A list of Data Subjects to be added to a Consent Group, identified either by their id or their identifier value",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConsentAPI_DataSubjectInformation"
            },
            "maxItems": 2147483647,
            "minItems": 1
          }
        }
      },
      "ConsentAPI_DataSubjectInformation": {
        "type": "object",
        "properties": {
          "id": {
            "description": "Unique Identifier identifying a Data Subject",
            "type": "string",
            "format": "uuid",
            "example": "633ba071-61b0-485f-81a0-a2245777b432"
          },
          "identifier": {
            "description": "The Data Subject identifier value",
            "type": "string",
            "example": "example@otprivacy.com"
          }
        }
      }
    },
    "securitySchemes": {
      "ConsentAPI_OAUTH2": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://{hostname}/api/access/v1/oauth/token",
            "scopes": {
              "CONSENT": "Consent Scope gives the user access to read/write operations",
              "CONSENT_READ": "Consent Read Scope gives the user read-only access"
            }
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": false,
    "proxy-enabled": false,
    "metrics-enabled": false
  },
  "x-onetrust": {
    "spec-label": "OpenAPI 3.1.0"
  }
}
```