# Update leads Tag with REST API

**URL:** https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186
**Category:** Product Support
**Created:** [April 7, 2016, 9:55pm UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186 "2016-04-07T21:55:48Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pixman](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@pixman](https://forum.mautic.org/u/pixman)
#### Post date: [April 7, 2016, 9:55pm UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186/1 "2016-04-07T21:55:48Z")

</div>

Hello,  
  
I connect mautic with my CRM. I have connected them with the REST API.  
  
Now i want to manage a the tags, for identify some action provide by my CRM for my lead list segmentation.  
  
  
  
In the developper documentation i don’t see how i can add, remove or update tags into my lead with REST API.  
  
Thanks for your help.

---

<div class="post-metadata">

### Author: ![startfinance](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@startfinance](https://forum.mautic.org/u/startfinance)
#### Post date: [May 9, 2016, 1:11am UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186/2 "2016-05-09T01:11:24Z")

</div>

I was looking for the same thing

=(

---

<div class="post-metadata">

### Author: ![pixman](https://avatars.discourse-cdn.com/v4/letter/p/a3d4f5/32.png) [@pixman](https://forum.mautic.org/u/pixman)
#### Post date: [April 7, 2016, 9:55pm UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186/3 "2016-04-07T21:55:48Z")

</div>

Hello,  
I connect mautic with my CRM. I have connected them with the REST API.  
Now i want to manage a the tags, for identify some action provide by my CRM for my lead list segmentation.

In the developper documentation i don’t see how i can add, remove or update tags into my lead with REST API.  
Thanks for your help.

---

<div class="post-metadata">

### Author: ![gstark](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@gstark](https://forum.mautic.org/u/gstark)
#### Post date: [April 6, 2017, 11:11pm UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186/4 "2017-04-06T23:11:32Z")

</div>

I know it’s a year later, but I had trouble finding this out via the documentation a well, so figured I’d update this here question.

You can use the ` PUT /contacts/ID/edit ` which takes a map of fields to values. You can add “tags” as a field with the value being a comma separated list of the Tags as you want them to be (i.e. Make sure you add the current tags to your value before submitting, or they’ll be blown out). This is actually true for the endpoint as a whole, in my experience. You have to send ALL fields with their current or updated value or they’ll be blown out.

Something like:

```auto
{
"first_name":"John",
"last_name":"Smith",
...
"tags":"Tag1,Tag2,Tag3"
}
```

For reference: [https://github.com/mautic/mautic/issues/3161](https://github.com/mautic/mautic/issues/3161)

---

<div class="post-metadata">

### Author: ![rafalima](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rafalima/32/1777_2.png) [@rafalima](https://forum.mautic.org/u/rafalima)
#### Post date: [February 23, 2020, 9:52am UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186/5 "2020-02-23T09:52:53Z")

</div>

Take a look at this script:

> **[rafaelp/mautic-tags-import](https://github.com/rafaelp/mautic-tags-import)**
>
> Ruby script to add tags to contacts on Mautic via CSV file - rafaelp/mautic-tags-import

---

<div class="post-metadata">

### Author: ![shairu](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/shairu/32/9486_2.png) [@shairu](https://forum.mautic.org/u/shairu)
#### Post date: [March 28, 2023, 3:24pm UTC](https://forum.mautic.org/t/update-leads-tag-with-rest-api/5186/6 "2023-03-28T15:24:06Z")

</div>

I think you can set a special parameter so it doesn’t overwrite if it already exists: [Mautic Developer Documentation](https://developer.mautic.org/#edit-contact) the `overwriteWithBlank` param determines that i think
