Update Entity Tags
Set the tags that wrap an entity's tokens in masked text, for every policy in your namespace.
Endpoint
Set the tags that wrap an entity's tokens in masked text, for every policy in your namespace.
| Method | Route | Headers |
|---|---|---|
| PUT | {baseurl}/vault/metadata/personal-data-entities/update-entity-tags | Authorization: Bearer <vault-user-api-key> |
The API key needs the metadata_change permission. The super-admin token is not accepted.
Request body
Send one entity per request, with format_prefix, format_suffix, or both. A tag you leave out keeps its current value.
| Field | Type | Required | Description |
|---|---|---|---|
data | object | Yes | The entity and its new tags. |
data.entity_name | string | Yes | The entity to change, for example, PERSON. |
data.format_prefix | string | No | The opening tag, for example, <NAME>. Must not be empty. |
data.format_suffix | string | No | The closing tag, for example, </NAME>. Must not be empty. |
A policy_name in the body is ignored. The change always applies to the whole namespace.
Example request
{
"data": {
"entity_name": "PERSON",
"format_prefix": "<NAME>",
"format_suffix": "</NAME>"
}
}
Response
On success, the call returns the entity and tags you sent with a confirmation message.
| Field | Type | Description |
|---|---|---|
data.entity_name | string | The entity that was changed. |
data.format_prefix | string | The new opening tag. |
data.format_suffix | string | The new closing tag. |
data.message | string | Confirmation that the namespace tags were updated. |
success | boolean | true when the tags were updated. |
error.message | string | Empty on success. |
Example response
{
"data": {
"entity_name": "PERSON",
"format_prefix": "<NAME>",
"format_suffix": "</NAME>",
"message": "Updated wrappers for entity PERSON at namespace level. Policies with their own prefix/suffix keep it."
},
"success": true,
"error": {"message": ""}
}
Tag behavior
The new tags apply to every policy in the namespace, including the default policy and policies created later. A policy whose tags were set with Update Auto-Detect keeps its own tags.
The token itself does not change. For example, <PER>wigR</PER> becomes <NAME>wigR</NAME>.
Text masked with the old tags can no longer be unmasked. Unmask stored text before you change an entity's tags.
Errors
Invalid requests return HTTP 200 with success: false and the reason in error.message. Nothing is changed.
{
"data": {},
"success": false,
"error": {"message": "Entity NOPE not found in namespace."}
}
A request is rejected when:
entity_nameis missing or empty:Empty entity_name. Provide a valid entity_name- Neither
format_prefixnorformat_suffixis sent:Provide format_prefix and/or format_suffix - A tag is an empty string:
Prefix for PERSON must not be empty.or the corresponding suffix message. - A tag is not a string:
format_prefix must be a string - The entity does not exist in your namespace:
Entity NOPE not found in namespace. - The API key lacks the
metadata_changepermission:Permission Denied
An unexpected server error returns HTTP 500 with Error in updating entity wrappers.