PATCH /hub/v1/nestedtags/{tagId}

Updates an existing tag. Provide only the tag fields to be changed.

URL Parameters 

NameTypeDescription
tagIdnumberRequired. ID of the tag to patch.

JSON Parameters 

NameTypeDescription
idnumberRequired. TagId of the tag to update.
namestringName of the tag, up to 120 characters. The only special characters allowed are period (.) and apostrophe (‘).
descriptionstringDescription of the tag, up to 256 characters. The only special characters allowed are period (.), apostrophe (’), comma (,), and forward slash (/). If you don’t provide a description, the existing description isn’t changed.
parentIdnumberTagId that you want to be the parent of this tag. If you don’t provide a parentId, the parentId isn’t changed.
tagsobjectA list of tags to create as nested tags. If you don’t provide a list of tags, the existing nested tags aren’t changed.

Responses 

StatusNameTypeDescription
200  Response includes the updated tag and all of its properties, including nested tags at the level specified by the depth parameter.
 idintegerTagId of the tag.
 namestringName of the tag.
 descriptionstringDescription of the tag.
 parentIdstringTagId of the parent tag. This field is null or zero if no parent tag exists.
 tagsobjectA list of the tag’s nested tags.

Usage 

This example patches a nested tag to update its description field.

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2PATCH /hub/v1/nestedtags/18
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7    "id": 18,
8    "description": "Platinum Membership Level - the highest level"
9}

The response includes the updated information for the tag.

1HTTP/1.1 200 OK
2{
3  "id": 18,
4  "name": "Platinum",
5  "description": "Platinum Membership Level - the highest level",
6  "modifiedDate": "2019-06-14T11:58:00",
7  "parentId": 14
8}

This example changes a nested tag into a root tag with no parent.

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2PATCH /hub/v1/nestedtags/18
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7    "id": 18,
8    "parentId": 0
9}

The response indicates the changed status of the tag.

1HTTP/1.1 200 OK
2{
3  "id": 18,
4  "name": "Platinum",
5  "description": "Platinum Membership Level - the highest level",
6  "modifiedDate": "2019-06-14T11:58:00",
7  "parentId": 0
8}