Skip to main content
PATCH
Update all the tags from an AI contact

Overview

Update (replace) all tags for a specific contact. This endpoint completely replaces the contactโ€™s current tags with a new set of tag IDs. Use this when you want to set the exact tag list for a contact. Tags help you organize, filter, and segment contacts based on characteristics, behaviors, or any custom criteria relevant to your business.

Use Cases

  • Contact Categorization: Organize contacts by customer type, status, or segment
  • Workflow Automation: Update tags based on customer actions or events
  • Data Sync: Sync tags from external CRM systems
  • Bulk Updates: Programmatically update contact tags in batch operations
  • Customer Journey: Tag contacts as they progress through your funnel
  • Segmentation: Create dynamic segments based on tag combinations

Authentication

This endpoint requires authentication using an API key. Include your API key in the request header:

Path Parameters

Request Body

Response Structure

Example Request

Example Response

Common Use Cases

1. Replace All Contact Tags

2. Remove All Tags from Contact

3. Update Tags Based on Customer Behavior

4. Sync Tags from External CRM

5. Bulk Tag Update for Multiple Contacts

6. Add Tag Without Removing Existing Ones

Important Behavior

โš ๏ธ Replaces All Tags

This endpoint replaces the contactโ€™s tags completely. If a contact has tags [1, 2, 3] and you send tagsIds: [4, 5], the contact will end up with only [4, 5]. Before: Contact has tags [1, 2, 3] Request: { "tagsIds": [4, 5] } After: Contact has tags [4, 5]

Adding vs Replacing

  • To add a tag: First get existing tags, append new ID, then update
  • To remove a tag: Get existing tags, filter out the unwanted ID, then update
  • To replace all: Simply send the new list (this endpoint)

Tag ID Requirements

  • All tag IDs must exist in your organization
  • All tag IDs must belong to your account
  • Invalid tag IDs will cause the request to fail with a 400 error
  • Tag IDs are numeric integers, not UUIDs

Error Responses

Getting Tag IDs

To get available tag IDs for your organization, use the Get All Tags endpoint:
View Documentation This returns all your tags with their IDs, names, types, and colors. Workflow:
  1. Call GET /api/public/tags to get all available tags
  2. Find the tag IDs you need (by name or other criteria)
  3. Use those IDs with this endpoint to update contact tags

Best Practices

1. Validate Tag IDs Before Updating

2. Handle Errors Gracefully

3. Remove Duplicates

Tag Types

Tags can be of two types:
  1. CONTACT Tags: Associated with the contact permanently
  2. TICKET Tags: Only assigned when a contact has an active ticket
When using this endpoint, both types can be updated, but TICKET tags will only appear when the contact has an active ticket.

Notes

  • Atomic Operation: The tag update is atomic - either all tags are updated or none
  • No Partial Updates: You cannot update tags one at a time with this endpoint
  • Immediate Effect: Changes take effect immediately
  • Activity Logged: Tag changes are logged in the contactโ€™s activity history

Headers

x-api-key
string
required

API key required to authorize the request

Path Parameters

aiContactId
string
required

ID of the AI contact

Body

application/json
tagsIds
number[]

Response

Tags updated successfully.