Tag Customers (to Labels)

Lets you tag a customer to one or more customer labels or remove an existing label.

👍

Note

For detailed information about the APIs and for hands-on testing, refer to the API overview documentation and step-by-step guide on making your first API call.

Prerequisites

  • Basic Authentication
  • Default access group

Resource information

URL/customers/userId/changeLabels
HTTP MethodGET
PaginationNo
Batch supportNo
Rate limit informationNone

Example cURL request

curl --location 'https://eu.api.capillarytech.com/v2/customers/564663098/changeLabels' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Authorization: Basic c2FudC5wXzEyMzpiMmVhMGFhYWI1ZThmODg5ZzNGE2NjA5NTIwM2FlNw==' \
--header 'Cookie: _cfuvid=fbS1QUjcPWKTrqnhF5ahlGc4y1sg7UG0MiosK.TUazU-1750677923205-0.0.1.1-604800000' \
--data-raw '{
    "add": [
        {
            "labelName":"Valuable Customer shvdshjdvshdvhjsdvjasajshjahadjgciuwyeguhbcwjhbjdshsbcjhwhewbehcbwjdhbckwjhekjhcbw"
        },
        {
            "labelName": "Old1 Customer1"
        },
        {
            "labelName": "Old2 Customer2"
        },
        {
            "labelName": "Testing_UAT_@_123"
        }
    
    ],
    "remove": [
        {
            "labelName": ""
        },
        {
            "labelName": ""
        }
    ]
}'

Path Parameter

ParameterData typeDescription
userIdIntegerUnique identifier of the customer for whom labels are being modified.

Request Parameters

ParameterData TypeDescription
addArrayArray of label objects to add to the customer.
-labelNameStringName of the label to add. Required.
removeArrayArray of label objects to remove from the customer.
-labelNameStringName of the label to remove. Required.

Sample Response

{
    "entity": 564663098,
    "warnings": []
}

Response Parameter

ParameterData TypeDescription
successBooleanIndicates whether the label change was successful (true or false).
messageStringDetails about the result of the operation.
errorCodeStringError code if the request failed.
errorsArrayList of individual error messages, if any.

API Specific Error Codes

Error CodeDescriptionReason
33001User labels not foundThis error occurs when the specified labels for the user cannot be found. Usually happens if the user does not have any labels assigned or the label references are incorrect.
8015Customer not foundThis error occurs when the given userId or identifiers do not match any existing customer in the system. Often caused by invalid or missing user ID.
33000Label not foundThis error occurs when an incorrect or non-existent labelName is provided in the request body.
{
    "warnings": [
        {
            "status": false,
            "code": 33001,
            "message": "User labels not found"
        }
    ],
    "errors": []
}
{
    "errors": [
        {
            "status": false,
            "message": "Customer not found for the given identifiers",
            "code": 8015
        }
    ]
}
{
    "entity": 565345934,
    "warnings": [
        {
            "status": false,
            "code": 33000,
            "message": "123212100000Old Customer000000000000 label not found"
        }
    ]
}
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!