Ray Allen claims he was catfished by a man pretending to be a number of attractive women -- and now he's filed legal docs to make sure the alleged catfisher doesn't leak his private information.

It's all in legal docs obtained by TMZ Sports ... the ex-NBA superstar claims he met these "women" in "various online forums" and communicated with them ... sometimes sharing "private information."

Ray claims he eventually figured out he was being catfished and ended the relationships -- but the man behind the rouse became obsessed and began posting items on social media about Ray and his family.

In the docs, Allen claims the man would physically go to Ray's wife's restaurant in Orlando and post about Ray -- tagging family members in the posts. Creepy stuff.

Ray says he got the guy to sign a confidentiality agreement in which he agreed to stop posting about Ray -- but the guy violated the deal.