You may have heard the term certificate of occupancy bandied about with regard to building projects. What a certificate of occupancy does is certify that a building is safe to inhabit. The document lists what the allowable uses are for a building, floor by floor.
This is why it makes civic leaders cringe when community members think that they can use their building in whatever way they please, contrary to their certificate of occupancy. For example, we hear this gem all the time: Well my son lives in the basement, but it's legal because he's family. No. The legal use of your basement is listed on the certificate of occupancy. It typically says something like storage or boiler room. It likely does not authorize a living area and is unsafe for someone to live there.
All buildings constructed after 1938 have a certificate of occupancy. If you live in an older home without one, it doesn't mean you can just do anything with the building. If you make an alteration or change the use of the structure, then you are required to obtain a new certificate of occupancy. For your family's safety, please abide by your certificate of occupancy. If you are searching for an apartment, please look at the address' certificate of occupancy on the DOB's website in order to determine whether or not the apartment is legal before you provide a deposit. The link for the C of O is located in the upper right corner of the house's online record, which can be accessed via www.nyc.gov/buildings.