Tags and contact fields API
Create, rename and delete tags and custom contact fields, and add tags to contacts or take them off.
/v1/tags#List tags
Every WhatsApp CRM contact tag with its tag_id and how many contacts carry it. Tags group contacts for GET /v1/contacts and POST /v1/broadcasts.
Permission: contacts:view
Takes no parameters.
curl "https://backend.sheetwa.com/v1/tags" \
-H "Authorization: Bearer $SHEETWA_API_KEY"/v1/tags#Create a tag
Creates a WhatsApp CRM contact tag. If the name exists, returns that tag_id with already_existed: true, so it is safe to repeat.
Permission: contacts:change
Body parameters (1)
namerequiredstring
The tag name, e.g.VIP.
curl -X POST "https://backend.sheetwa.com/v1/tags" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP"
}'/v1/tags/assign#Add tags to contacts
Adds tags to WhatsApp CRM contacts, keeping the tags they already have. Up to 20 tags and 500 contacts per call. Safe to repeat.
Permission: contacts:change
Body parameters (2)
tag_idsrequiredstring[]
tag_idvalues from GET /v1/tags.contact_idsrequiredstring[]
contact_idvalues from GET /v1/contacts.
curl -X POST "https://backend.sheetwa.com/v1/tags/assign" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tag_ids": [
"TAG_ID"
],
"contact_ids": [
"CONTACT_ID"
]
}'/v1/tags/unassign#Remove tags from contacts
Removes tags from WhatsApp CRM contacts. A contact always keeps at least one tag: refuses with CANNOT_UNASSIGN_LAST_TAG and lists the contacts affected.
Permission: contacts:change
Body parameters (2)
tag_idsrequiredstring[]
tag_idvalues from GET /v1/tags.contact_idsrequiredstring[]
contact_idvalues from GET /v1/contacts.
curl -X POST "https://backend.sheetwa.com/v1/tags/unassign" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"tag_ids": [
"TAG_ID"
],
"contact_ids": [
"CONTACT_ID"
]
}'/v1/tags/{tag_id}#Rename a tag
Changes a WhatsApp CRM tag's name everywhere. Fails with DUPLICATE_TAG, carrying existing_tag_id, when another tag has that name.
Permission: contacts:change
Path parameters (1)
tag_idrequiredstring
Atag_idfrom GET /v1/tags.
Body parameters (1)
namerequiredstring
The new name.
curl -X PATCH "https://backend.sheetwa.com/v1/tags/TAG_ID" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP"
}'/v1/tags/{tag_id}#Delete a tag
Deletes a WhatsApp CRM tag and removes it from every contact. Refuses with TAG_DELETE_WOULD_ORPHAN when some contacts have only this tag; give them another with POST /v1/tags/assign first. Owner or admin keys only.
Permission: contacts:change
Path parameters (1)
tag_idrequiredstring
Atag_idfrom GET /v1/tags.
curl -X DELETE "https://backend.sheetwa.com/v1/tags/TAG_ID" \
-H "Authorization: Bearer $SHEETWA_API_KEY"/v1/contact-attributes#List custom contact fields
Custom fields WhatsApp CRM contacts can carry: key, label, type. Use the key values in the attributes object of POST /v1/contacts and PATCH /v1/contacts/{contact_id}.
Permission: contacts:view
Takes no parameters.
curl "https://backend.sheetwa.com/v1/contact-attributes" \
-H "Authorization: Bearer $SHEETWA_API_KEY"/v1/contact-attributes#Create a custom contact field
Adds a custom field to every WhatsApp CRM contact, e.g. "City" (text) or "Renewal date" (date). The key is generated from the label; read it with GET /v1/contact-attributes. Owner or admin keys only.
Permission: contacts:change
Body parameters (2)
labelrequiredstring
The field name people see.typerequired"text" | "number" | "date" | "boolean"
booleanis a yes/no field.
curl -X POST "https://backend.sheetwa.com/v1/contact-attributes" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "City",
"type": "text"
}'/v1/contact-attributes/{attribute_id}#Rename a custom contact field
Changes the label of a custom WhatsApp CRM contact field. Its key, type and saved values stay. Owner or admin keys only.
Permission: contacts:change
Path parameters (1)
attribute_idrequiredstring
Anattribute_idfrom GET /v1/contact-attributes.
Body parameters (1)
labelrequiredstring
The new label.
curl -X PATCH "https://backend.sheetwa.com/v1/contact-attributes/ATTRIBUTE_ID" \
-H "Authorization: Bearer $SHEETWA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "City"
}'/v1/contact-attributes/{attribute_id}#Delete a custom contact field
Removes a custom WhatsApp CRM contact field. Saved values stay on contacts but are no longer shown. Cannot be undone. Owner or admin keys only.
Permission: contacts:change
Path parameters (1)
attribute_idrequiredstring
Anattribute_idfrom GET /v1/contact-attributes.
curl -X DELETE "https://backend.sheetwa.com/v1/contact-attributes/ATTRIBUTE_ID" \
-H "Authorization: Bearer $SHEETWA_API_KEY"