# Blocking updates to a segment

**URL:** <https://forum.mautic.org/t/blocking-updates-to-a-segment/26490>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [December 22, 2022, 6:48pm UTC](https://forum.mautic.org/t/blocking-updates-to-a-segment/26490 "2022-12-22T18:48:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![slim2k](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/slim2k/32/7468_2.png) [@slim2k](https://forum.mautic.org/u/slim2k)\
**Post date:** [December 22, 2022, 6:48pm UTC](https://forum.mautic.org/t/blocking-updates-to-a-segment/26490/1 "2022-12-22T18:48:02Z")

</div>

**Your software**  
My Mautic version is: v4.4.5  
My PHP version is: 7.4.33  
My Database type and version is: percona/percona-server:5.7

**Your question**

I have a segment driven off of data loaded from an API. It is important that other user’s in Mautic not be able to add contacts to this segment. What is the best way to keep this segment clean so it is accurate only to the criteria in the segment and does not allow exceptions to the filters?

If it can’t be blocked somehow, the API allows me to remove contacts from the segment but identifying any that don’t match the filter looks pretty inefficient. I would need to get all contacts then make an API to check to see if they are in that segment or not then make the change if necessary. Kind of like looking for a needle in a haystack.

Maybe I should dig into the tables and come up with a query to do this?

Thank you,  
Jimmy

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [December 23, 2022, 6:53am UTC](https://forum.mautic.org/t/blocking-updates-to-a-segment/26490/2 "2022-12-23T06:53:20Z")

</div>

Here is an example how I solved it:

[![](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0bc9562b34af41025814bc4c8090ea55addd7d17.jpeg "Smart Segment Processing Script for Mautic") ](https://www.youtube.com/watch?v=Ui-zGW7mYhE)

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [December 23, 2022, 2:15pm UTC](https://forum.mautic.org/t/blocking-updates-to-a-segment/26490/3 "2022-12-23T14:15:16Z")

</div>

One way you could go about “blocking” the segment from others touching it would be in the User Roles Permissions, and inside the role for Mautic Users to define them as only being able to view others but not edit others, and then have your API in a different role.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [February 9, 2023, 11:53am UTC](https://forum.mautic.org/t/blocking-updates-to-a-segment/26490/4 "2023-02-09T11:53:35Z")

</div>

Closed on February 9, 2023, 11:53am UTC

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
