The city tried to discontinue the practice in 1866, but it was quickly reinstated.
31 May 1923, New York Times, pg. 8:
FIND KEY TO THE CITY
OPENS NOTHING HERE
Although possessed of "the key to the city," graciously bestowed from the steps of City Hall by Mayor Hylan, four young Allentown, Pa., athletes, members of the team that won the relay race from the Pennsylvania city to New York on Tuesday, found yesterday that the "key" unlocked very little hospitality. Stranded here through a set of circumstances not of their making the youths applied to Police Headquarters for assistance in getting back to their homes.
8 July 1966, New York Times, pg. 28:
Print of City Hall to Replace Traditional Key as Gift to Visitors
"Key to the City" Custom Ended Here
By CHARLES G. BENNETT
New York has quietly abandoned the practice of giving keys to the city to distinguished visitors and honored guests.
New York's earliest tangible term of this kind, originating in the early 1900's, according to Mr. Gormley, was the Freedom of the City. To symbolize this, a distinguished guest received a gold box containing whatever small mementos or gifts the head of the city wanted to give him.
By the middle 1800's, it was explained, it became the custom to give a key to the city, as a direct symbol of the city's wish that a guest feel free to come and go at will.
The former keys to the city were described last night by a city aide as of highly burnished brass, giving a gold appearance, about 6 inches long. The top of the key was an oval loop about 3 inches across. The key nestled in the red plush interior of a hard black case.
The number of keys presented in a single year varied, but generally it was not more than five or six. (...)
According to public events aides, there apparently has been no rule of thumb to determine who gets the symbol of the city's welcome. Heads of Government and chiefs of state would automatically receive it.