> ## 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 Consent Groups to Parent Consent Group

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

> 🗒 Things to Know
> 
> - A Consent Group can only be added as a child to one Parent Consent Group.
> - 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 Consent Groups are added as children to the Parent Consent Group, data subjects cannot be added to the Parent Consent Group at that given level.
> - Consent Groups can support a hierarchical structure of up to 4 levels. However, once data subjects are added as children to a Parent Consent Group, no additional Consent Groups can be added to that 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}/consent-groups": {
      "post": {
        "operationId": "addConsentGroupsToConsentGroupUsingPOST",
        "summary": "Add Consent Groups to Parent Consent Group",
        "description": "Use this API to add Consent Groups as children of the specified Parent Consent Group.\n\n> 🗒 Things to Know\n> \n> - A Consent Group can only be added as a child to one Parent Consent Group.\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 Consent Groups are added as children to the Parent Consent Group, data subjects cannot be added to the Parent Consent Group at that given level.\n> - Consent Groups can support a hierarchical structure of up to 4 levels. However, once data subjects are added as children to a Parent Consent Group, no additional Consent Groups can be added to that 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](/onetrust/reference/getconsentgrouplistusingget) API.",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "example": "1a6c1e65-aa4f-4d79-ac62-7fe905616f71"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsentAPI_ConsentGroupConsentGroupsRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Consent Groups added 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_ConsentGroupConsentGroupsRequest": {
        "type": "object",
        "properties": {
          "consentGroupIds": {
            "description": "A list of Consent Groups to be added to a Consent Group as its children, identified by their ids",
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "example": [
              "3b3ecf8f-afe5-4ff3-a621-5c519a385fae",
              "fa3ecf8f-afe5-41f3-a621-5c519a38521e"
            ],
            "maxItems": 2147483647,
            "minItems": 1
          }
        }
      }
    },
    "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"
  }
}
```