Skip to main content
POST
Create tags for a contact

Overview

Create and assign tags to a contact using their channel information (phone number or username) instead of contact ID. This endpoint is perfect when you know the contact’s phone/username but not their Vambe contact ID. The endpoint automatically creates tags that don’t exist and intelligently handles TICKET-type tags (only assigned when the contact has an active ticket).

Use Cases

  • Webhook Integration: Tag contacts from external webhooks using phone numbers
  • Form Submissions: Tag contacts from web forms without looking up their ID
  • CSV Imports: Bulk tag contacts using phone numbers from spreadsheets
  • E-commerce Events: Tag customers after purchases using their phone
  • Marketing Automation: Auto-tag contacts from campaign responses
  • Support Tickets: Tag customers when tickets are created in external systems

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

Example Response with Ticket Tags

When a contact has no active ticket and you try to assign TICKET-type tags:

Common Use Cases

1. Tag Contact from Webhook

2. Tag Customer After Purchase

3. Tag from Form Submission

4. Bulk Tag from CSV

5. Tag Instagram Contact

6. Campaign Response Tagging

Channel Types

Platform Identifier Formatting

The endpoint automatically cleans the platform identifier:
  • Removes + symbols
  • Removes spaces
  • Normalizes the format
So these are all equivalent:
  • +56912345678
  • 56912345678
  • +569 1234 5678

Tag Creation Behavior

Automatic Tag Creation

If a tag doesn’t exist, it will be automatically created for your organization: Request: { "tags": ["new-tag-2024"] }
  1. System checks if tag “new-tag-2024” exists
  2. If not, creates it
  3. Assigns it to the contact
  4. Returns createdCount: 1

Tag Assignment

  • CONTACT Tags: Always assigned to the contact
  • TICKET Tags: Only assigned if contact has an active ticket

Response Breakdown

Example Scenario:
  • Request tags: ["customer", "vip", "urgent-ticket"]
  • “customer” and “vip” exist as CONTACT tags
  • “urgent-ticket” exists as a TICKET tag
  • Contact has NO active ticket
Response:

Error Responses

Important Notes

  • Auto-Create: Tags are automatically created if they don’t exist
  • Additive Operation: This endpoint adds tags, it doesn’t replace existing ones
  • Case Sensitive: Tag names are case-sensitive
  • Duplicates: Duplicate tags in the array won’t create duplicate assignments
  • Contact Lookup: Contact must exist with the specified platform identifier
  • Phone Format: Phone numbers should include country code (e.g., +56 for Chile)

Differences from PATCH Endpoint

Best Practices

1. Normalize Phone Numbers

2. Handle Ticket Tags Gracefully

3. Use Consistent Tag Naming

Complete Workflow Example

Headers

x-api-key
string
required

API key for request authorization

Path Parameters

platformIdentifier
string
required

The platform identifier for the contact, e.g. phone number (with country code) or username

channelType
enum<string>
required

The type of channel to create a tag for

Available options:
whatsapp,
playground,
web-whatsapp,
instagram

Body

application/json
tags
string[]

Response

Tags processed successfully

status
string
Example:

"success"

createdCount
number
Example:

2

assignedCount
number
Example:

3

notAssignedCount
number
Example:

1

notAssignedTags
string[]
Example:
details
string
Example:

"Some tags were not assigned because they are TICKET type and the contact has no active ticket."