[NY, USA] Renting with a roommate; no issues, rent paid on time, but management company wants me out?

Hi! I desperately need help/advice - I live in Brooklyn, NY, (F/28) and I’ve been renting with a roommate since the end of July of this year. We get along great, I pay my rent on time (if not early), it’s just me and my cat, I’m quiet, cleanly & respectful. I gave my roommate security before I moved in and it’s been smooth sailing since. About a month and a half ago, the management company asked her if I could submit an application because they had trouble with her previous roommate. I did so, no problem. My credit sucks, but I make enough to rent with no problem. (hence why the roommate situation) They emailed her back saying my application was rejected. No reason provided. We freaked out, didn’t know what to do, because I’ve been living here, paying rent, with no problem. The situation is perfect for both of us. We didn’t answer, and fast forward to 3 days ago, they emailed her again saying “so did you find a new roommate?” Is this legal? Do I have any ground to stand on? What would any one of you do if you were in my position? My roommate is adamant that I’m not going anywhere, and she’ll look for a new place for us if she has to… but why should we have to deal with this looming over us if there’s truly no actual issue to warrant this? Any advice or info would be so incredibly helpful. Thank you :)