NY Elec L § 16-106 (2021)
2021 New York Laws ELN - Election Article 16 - Judicial Proceedings 16-106 - Proceedings as to the Casting and Canvass of Ballots.

§  16-106.  Proceedings  as  to the casting and canvass of ballots. 1.   The casting or canvassing or refusal to cast challenged  ballots,  blank   ballots,  void  or  canvass absentee, military, special federal, federal   write-in or emergency ballots and ballots voted in  affidavit  envelopes   by  persons  whose  registration  poll records were not in the ledger or   whose names were not on the computer generated registration list on  the   day  of election or voters in inactive status, voters who moved to a new   address in the city or county or after they  registered  or  voters  who   claimed  to  be  enrolled  in  a  party  other  than that shown on their   registration poll record or on the computer generated registration  list   and  the  original applications for a military, special federal, federal   write-in, emergency or absentee voter's ballot may  be  contested  in  a   proceeding  instituted  in the supreme or county court, by any candidate   or the chairman of any party committee, and by any voter with respect to   the refusal to cast such voter's ballot, against the board of canvassers   of the returns from such district, if any,  and  otherwise  against  the   board  of  inspectors  of  election  of  such  district.  If  the  court   determines that the person who cast such ballot was entitled to vote  at   such  election,  it  shall order such ballot to be cast and canvassed if   the court finds that ministerial error by the board of elections or  any   of  its  employees  caused  such  ballot envelope not to be valid on its   face.2. The canvass of returns by the  state,  or  county,  city,  town  or   village board of canvassers may be contested, in a proceeding instituted   in the supreme court by any voter, except a proceeding on account of the   failure  of  the  state board of canvassers to act upon new returns of a   board of canvassers of any county made pursuant to the order of a  court   or  justice,  which may be instituted only by a candidate aggrieved or a   voter in the county.3. The attorney general, on behalf of the state, and the  chairman  of   the  state  committee  of  a party, may institute any proceeding allowed   herein relating to the returns of canvass by inspectors upon the vote of   any ballot proposal submitted to the people of the state.4. The court may direct a recanvass or the correction of an error,  or   the  performance  of  any  duty  imposed by law on such a state, county,   city, town or village board of inspectors, or canvassers.5. A proceeding under subdivisions one and three of this section  must   be  instituted  within  twenty  days  and  under subdivision two, within   thirty days  after  the  election  or  alleged  erroneous  statement  or   determination  was  made, or the time when the board shall have acted in   the particulars as to which it is claimed to have failed to perform  its   duty,  except  that such a proceeding with respect to a village election   must be instituted within  ten  days  after  such  election,  statement,   determination or action.