Assign Custom Fields and/or Tags to Customer

Easily assign custom fields and tags to customers using the DoubleTick API, enabling better segmentation and personalized interactions. πŸ·οΈβœ…

API Endpoint

Use the following endpoint to assign custom fields and tags to a customer:

POST https://public.doubletick.io/customer/assign-tags-custom-fields

Request Headers

{
  "Authorization": "YOUR_API_KEY",
  "Content-Type": "application/json"
}

Request Body Parameters

{
    "phone": "customer_number",
    "tags": ["tag_name"],
    "name": "customer_name",
    "optIn": true,
    "customFields": [
        {
            "name": "field_name",
            "value": "field_value"
        }
    ]
}

Parameters

  • phone (string, required): The customer’s phone number in international format.
  • tags (array of strings): An array of tags to be assigned to the customer.
  • name (string, optional): The customer’s name.
  • optIn (boolean, required): Indicates whether the customer has opted in for messages.
  • customFields (array of objects, optional): An array of key-value pairs representing custom fields.
    • name (string, required): The name of the custom field.
    • value (string, required): The value associated with the custom field.

Response

Success Response (201)

{
    "customFields": {
        "added": ["new field"],
        "errored": []
    },
    "tags": {
        "added": ["team lead"],
        "errored": []
    },
    "customerId": "customer_id"
}

Bad Request (400)

{
  "message": "error_message",
  "error": "Bad Request",
  "statusCode": 400
}

Unauthorized (401)

{
  "message": "Invalid public api key",
  "error": "Unauthorized",
  "statusCode": 401
}

Unprocessable Entity (422)

{
  "message": "invalid file type for audio: text/html; charset=utf-8",
  "error": "Unprocessable Entity",
  "statusCode": 422
}

Best Practices

  • Ensure that the customer exists before assigning fields or tags.
  • Use meaningful tags and custom fields for better segmentation.
  • Maintain customer data accuracy by updating fields regularly.

What’s Next

Explore more message types and enhance your WhatsApp communication with DoubleTick API