Skip to content
Guides

Tags

Tags are labels you put on contacts: customer, vip, attended-workshop. Contacts never see them. Use them to target campaigns, build segments and start automations.

Add and remove tags#

POST/api/v1/audiences/{id}/contacts/{email_or_id}/tagsPermission: contacts:write

Tags are referenced by name. A name that doesn't exist in the audience yet is created. Adding a tag the contact already has, or removing one they don't, does nothing, so the call is safe to repeat.

const { data } = await mm.contacts.tags({  audienceId,  email: "sam@example.com",  add: ["customer", "sourdough-club"],  remove: ["trial"],});
console.log(data?.tags); // ["newsletter", "customer", "sourdough-club"]
Response200 OKJSON
{  "object": "contact",  "id": "0199f0b2-6c1e-7a3d-9f2b-3c4d5e6f7a8b",  "added": ["customer", "sourdough-club"],  "removed": ["trial"],  "tags": ["newsletter", "customer", "sourdough-club"]}

added and removed list what actually changed; tags is the full set afterwards. Up to 50 names per list, 100 characters each.

Tag while adding a contact#

tags on POST /contacts adds tags in the same request. It never removes tags the contact already has.

TypeScript
await mm.contacts.create({  audienceId,  email: "sam@example.com",  tags: ["newsletter", "from-checkout"],});

Tags start automations#

An automation with a Tag added trigger starts for every contact that gets the tag, whether you add it in the app, on import or through the API. A common pattern: tag customer after the first purchase and let an onboarding series take it from there.