Nicki Minaj appears to have gotten a big pass by a starstruck cop who was on the verge of writing the singer a ticket ... until the officer realized who she was about to bust.
Nicki tweeted a pic of a note she says she wrote to the cop's daughter, in which she wrote, "My beautiful barb Ayana! You and your mom are amazing! Love always, Nicki."
Nicki says Ayana's mom is a traffic cop who was about to write her up.
It's unclear what traffic violation Nicki allegedly committed, but what is pretty clear ... sometimes it pays to be a celeb.
We reached out to several law enforcement agencies in the NYC area -- where Nicki is currently hanging out for Fashion Week -- but so far we don't know which agency let her skate.
One interesting thing ... an NYPD official told us ... they weren't going to investigate to see if it happened in their jurisdiction, because they had way more important things to do. Fair point.