---
title: "Update Data Subject's Data Elements"
method: POST
path: "/api/consentmanager/v1/datasubjects/dataelements"
tags: ["Data Subjects"]
---

# Update Data Subject's Data Elements

`POST /api/consentmanager/v1/datasubjects/dataelements`

## Request

- Base URL: `https://hostname`
- URL: `https://hostname/api/consentmanager/v1/datasubjects/dataelements`
- Auth: OAuth 2
  - Client credentials
  - Token URL: `https://{hostname}/api/access/v1/oauth/token` scopes: `CONSENT`

Use this API to create a new data subject or update an existing data subject. The data subject will be created or updated with the details provided in the request body.

> 🗒 Things to Know
> 
> - The data subject primary identifier cannot be updated. However, additional identifiers can be added, updated, or deleted:
>   - To add or update an additional identifier for a given data subject, set the `linked` parameter value to `true` and include a list of the additional identifiers within the `value` parameter.
>   - To remove an additional identifier from a given data subject, set the `linked` parameter value to `true` and leave the `value` parameter empty. Removed identifiers will remain associated with the data subject as data elements.
> - This API is not designed to be used in synchronous workflows and will not trigger integration events or reporting updates.

Below are templated examples of adding, editing, and deleting additional identifiers for the data subject.

```json Add
{
  "dataElements": [
    {
      "name": "ADDITIONAL_IDENTIFIER_TYPE", // For example: Email
      "linked": true, // When dealing with identifiers, set this value to true
      "value": ["EXISTING IDENTIFIER", "NEW_IDENTIFIER"] // Make sure to keep the existing identifier if you already have one for that type
    }
  ]
}
```
```json Edit
{
  "dataElements": [
    {
      "name": "ADDITIONAL_IDENTIFIER_TYPE", // For example: Email
      "linked": true, // When dealing with identifiers, set this value to true
      "value": ["EDITED IDENTIFIER"] // Make sure to keep the existing identifier if you already have one for that type
    }
  ]
}
```
```json Delete
{
  "dataElements": [
    {
      "name": "ADDITIONAL_IDENTIFIER_TYPE", // For example: Email
      "linked": true, // When dealing with identifiers, set this value to true
      "value": [] // Keep empty if you want to remove all additional identifiers that share the identifier type
    }
  ]
}
```

## Headers

- `dataSubjectIdentifier` string, required

## Request body

- ConsentPreferencesUniversalConsentPreferenceManagDataSubjectCreateDTO
  - `dataElements` ConsentPreferencesUniversalConsentPreferenceManagDataSubjectElementDTO[]: List containing the Data Subject's Data Elements
    - `name` string, required: The name of the data element
    - `value` object: The value of the data element
    - `linked` boolean: Indicates whether the data element can be used as an additional identifier
    - `interactionDate` string, date-time
  - `identifierType` string: The type of identifier used for the Data Subject
  - `language` string: The preferred language code for the Data Subject

## Response `200`

OK - Data elements successfully updated for the data subject.

- ConsentPreferencesUniversalConsentPreferenceManagDataSubjectDetailDTO
  - `id` string, uuid: Unique identifier for the Data Subject
  - `identifier` string, required: The Data Subject's identifier value (e.g., email, phone number)
  - `identifierType` string, required: The type of identifier used for the Data Subject
  - `canBePrimary` boolean: Indicates if the Data Subject can be used as a primary identifier for a group of related identifiers
  - `elements` ConsentPreferencesUniversalConsentPreferenceManagDataSubjectElementDTO[]: List of data elements associated with the Data Subject
    - `name` string, required: The name of the data element
    - `value` object: The value of the data element
    - `linked` boolean: Indicates whether the data element can be used as an additional identifier
    - `interactionDate` string, date-time
  - `messages` string[]: List of validation or processing messages related to the Data Subject
  - `additionalIdMessages` ConsentPreferencesUniversalConsentPreferenceManagAdditionalIdInvalidScenariosDto[]: List of validation messages related to additional identifiers
    - `name` string
    - `values` object

## Other responses

- `201`: Created - New data subject created successfully with the provided data elements.
- `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)
