Skip to main content
POST
/
v1
/
businesses
/
{businessId}
/
tags
/
values
/
{targetValueId}
/
merge
Merge tag values
curl --request POST \
  --url https://sandbox.layerfi.com/v1/businesses/{businessId}/tags/values/{targetValueId}/merge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "source_value_ids": [
    "3c90c3cc-0d44-4b50-8888-8dd25736052a"
  ]
}
'
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "key": "<string>",
    "value": "<string>",
    "type": "TagValue",
    "display_name": "<string>",
    "archived_at": "2023-11-07T05:31:56Z"
  }
}
This operation is used to merge one or more source tag values into a single target tag value. Upon merging, all taggable entities that are tagged with the source tag values are re-tagged to the target tag value, and all source tag values are archived after the merge. All tag values being operated on must be unarchived and belong to the same tag dimension.
Source tag values → The tag values that will be replaced and archived after the operation.Target tag value → The tag value that will replace all source tag values. The target tag value must already exist before calling the merge operation.

Example

  1. Taggable entity A is tagged with tag value 1.
  2. Taggable entity B is tagged with tag value 2.
  3. Tag value 3 is created.
  4. Merge Operation: Source tag values 1 and 2 are merged into target tag value 3. The endpoint returns the target tag value 3.
  5. Taggable entity A and taggable entity B are now tagged with 3 and no longer have tag values 1 and 2.
  6. Tag values 1 and 2 are now archived.

Use-cases

Bulk deduplication or consolidation of tag values.
  • Example deduplication: Location: san francisco & Location: SFLocation: San Francisco.
  • Example consolidation: Location: San Francisco & Location: San JoseLocation: Bay Area.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

Content-Type
string

Content-Type must be set to application/json.

Path Parameters

businessId
string<uuid>
required

The UUID of the business.

targetValueId
string<uuid>
required

The UUID of the tag value to merge into.

Body

application/json
source_value_ids
string<uuid>[]
required

UUIDs of the source tag value definitions to merge into the target. At least one source tag value UUID is required. All source tag values are archived after the merge, and all objects tagged with it are re-tagged to the target value. Source tag values must belong to the same tag dimension as the target.

Minimum array length: 1

Response

Tag values merged successfully. Returns the target tag value.

data
object
required