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.

MethodRouteHeaders
PUT{baseurl}/vault/metadata/personal-data-entities/update-entity-tagsAuthorization: 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.

FieldTypeRequiredDescription
dataobjectYesThe entity and its new tags.
data.entity_namestringYesThe entity to change, for example, PERSON.
data.format_prefixstringNoThe opening tag, for example, <NAME>. Must not be empty.
data.format_suffixstringNoThe 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.

FieldTypeDescription
data.entity_namestringThe entity that was changed.
data.format_prefixstringThe new opening tag.
data.format_suffixstringThe new closing tag.
data.messagestringConfirmation that the namespace tags were updated.
successbooleantrue when the tags were updated.
error.messagestringEmpty 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_name is missing or empty: Empty entity_name. Provide a valid entity_name
  • Neither format_prefix nor format_suffix is 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_change permission: Permission Denied

An unexpected server error returns HTTP 500 with Error in updating entity wrappers.