---
title: "Create Consent Group"
method: POST
path: "/api/consent/v2/consent-groups"
tags: ["Consent Groups"]
---

# Create Consent Group

`POST /api/consent/v2/consent-groups`

## Request

- Base URL: `https://hostname`
- URL: `https://hostname/api/consent/v2/consent-groups`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://{hostname}/api/access/v1/oauth/token` scopes: `CONSENT`

Use this API to create a new Consent Group by providing a name, description, and optional external name.

> 🗒 Things to Know
> 
> - If an external name is not defined, one will be generated automatically.

## Request body

- ConsentAPIConsentGroupRequest
  - `name` string: The Consent Group name
  - `description` string: A description of the Consent Group
  - `externalName` string: The Consent Group's external name. If not provided, this will be generated based on the name

## Response `201`

Consent Group created successfully.

- ConsentAPIConsentGroupDto
  - `name` string: The Consent Group name
  - `description` string: A description of the Consent Group
  - `externalName` string: The Consent Group's external name. If not provided, this will be generated based on the name
  - `consentGroupId` string, uuid: Unique identifier identifying a Consent Group
  - `membershipType` 'EMPTY' | 'CHILD_GROUPS' | 'DATA_SUBJECTS': Indicates whether the consent group has other consent groups as its children, or if it has data subjects associated to it
  - `purposeRules` ConsentAPIPurposeRuleDto[]: The Consent Group's Purpose Rules
    - `purposeId` string, uuid, required: Identifier identifying a Purpose
    - `enforcedStatus` string: The Transaction Status enforced by the Consent Group for this Purpose
    - `effectiveStatus` string: The Consent Group's effective Transaction Status for this Purpose, which is calculated based on the Consent Group hierarchy
  - `dataSubjects` ConsentAPIDataSubjectInformationDto[]: The Consent Group's Data Subjects
    - `id` string, uuid: Unique Identifier identifying a Data Subject
    - `identifier` string: The Data Subject identifier value
    - `purposes` ConsentAPIDataSubjectPurposeInformationDto[]: The Data Subject's Purpose list
      - `id` string, uuid: Identifier identifying a Purpose
      - `version` integer: The Purpose's version
      - `status` string: The Data Subject's actual consent status for this Purpose
      - `effectiveStatus` string: The Data Subject's effective status for this Purpose, in the context of the specified Consent Group
  - `consentGroups` ConsentAPIConsentGroupSummaryDto[]: Consent Groups that are children of the current Consent Group
    - `name` string: The Consent Group name
    - `description` string: A description of the Consent Group
    - `externalName` string: The Consent Group's external name. If not provided, this will be generated based on the name
    - `consentGroupId` string, uuid: Unique identifier identifying a Consent Group
    - `membershipType` 'EMPTY' | 'CHILD_GROUPS' | 'DATA_SUBJECTS': Indicates whether the consent group has other consent groups as its children, or if it has data subjects associated to it

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `429`: Too Many Requests. For more information, see [API Rate Limits](https://developer.onetrust.com/onetrust/reference/rate-limits-overview).
- `500`: Internal Server Error

---

[API](https://skmtc.dev/onetrust/apis/consent-preferences-universal-consent-preference-management.md) - [All operations](https://skmtc.dev/onetrust/apis/consent-preferences-universal-consent-preference-management/llms.txt) - [OpenAPI document](https://skmtc.dev/onetrust/apis/consent-preferences-universal-consent-preference-management/revisions/fe4a0697ec9d?raw)
