---
title: "Add Purpose Rules to Consent Group"
method: POST
path: "/api/consent/v2/consent-groups/{consentGroupGuid}/purpose-rules"
tags: ["Consent Groups"]
---

# Add Purpose Rules to Consent Group

`POST /api/consent/v2/consent-groups/{consentGroupGuid}/purpose-rules`

## Request

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

Use this API to add Purpose Rules to a Consent Group. These rules will dictate which Purposes will be overridden with the defined Enforced Status for data subjects within the given Consent Group.

> 🗒 Things to Know
> 
> - Each Purpose in a Consent Group has its own Purpose Rule which is comprised of an Enforced Status and Effective Status.
> - The Enforced Status is the Purpose Status that you want to apply for a particular Purpose.
> - The Effective Status is calculated using the Priority Scores across the entire Consent Group hierarchy for each Purpose.

## Path parameters

- `consentGroupGuid` string, uuid, required

## Request body

- ConsentAPIConsentGroupPurposeRulesRequest
  - `purposeRules` ConsentAPIPurposeRuleRequest[]: A list of Purpose Rules to be added to a Consent Group
    - `purposeId` string, uuid, required: Identifier identifying a Purpose
    - `enforcedStatus` string: The Transaction Status enforced by the Consent Group for this Purpose

## Response `201`

Purpose Rules added 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)
