Threats/attempts at parental alienation

What recourse is available when there are repeated threats and attempts to tell the child bad things about the parent they primarly reside with? (we do not have a custody agreement in place but the 4-year pattern is that dad has them every other weekend) The latest example is that he wanted to bring him home a night early or drop him off at 5:30 am so he could go to the gym, and I told him I had plans for the evening and didn’t feel like dropping him off that early was in our son’s best interests. He then said he would tell our son that I don’t want to see him and hung up on me. He then texted to say he was going to tell our children about an affair I had 4 years ago.

Is there any way to make this behavior stop?

If you go to court and file a child custody claim, the judge can include in the court order a provision about disparaging remarks and alienation of the love of the children to protect you in the future.