From Emmy Award-winning writer/producers Dan Goor and Michael Schur ("Parks and Recreation"), and starring Emmy Award winners Andy Samberg ("Saturday Night Live") and Andre Braugher ("Men of a Certain Age," "Homicide: Life on the Street"), BROOKLYN NINE-NINE is a new single-camera ensemble comedy about what happens when a talented, but carefree, detective gets a new captain with a lot to prove.
Filmed at CBS Studio Center - 4024 Radford Avenue, Studio City, Los Angeles, California, USA.
There is no 99th precinct in the NYPD, but exterior shots of the show's fictional precinct are actually of the 78th precinct in Brooklyn, New York. 
Andy Samberg was the first actor cast in the series. Creators Dan Goor and Mike Schur, pitched the idea to him after he left Saturday Night Live. He participated in the casting process with the other actors, including improvised chemistry tests.
Chelsea Peretti auditioned for the role that would become Rosa. When she didn't get that part, a character was created specifically for her.  The creators had previously worked with Chelsea as a writer on Parks and Recreation.
Detective Jake Peralta breaks the fourth wall in a television store after it gets robbed. Amy Santiago tries to get the list of employees that previously entered but Jake tells her that he already caught him with a camera hidden in the back of a stuffed bear. Back at the station after filling out the score on a game Jake and Amy have been doing for over a year, Jake makes fun of the new captain (because the last one let him do whatever he wanted) until he appears behind him. The new captain introduces himself as Raymond Holt and calls sergeant Terry Jeffords in who explains that since the birth of his twin daughters he's been afraid to do his job and introduces the people around the precinct. Later, Jake, Amy, Charles Boyle and Rosa Diaz are in an apartment trying to solve a break in when Jake gives out ties that he stole from Charles' desk. Ray appears behind him and everyone leaves. Charles asks Rosa out and she accepts only to drive off while he's talking. Ray tells Gina that he won't suspend her if she tells him what the bet with Jake and Amy is about and she says that he has to give her his car if she wins and if he wins she has to go on a date with him. Jake and Amy are at an apartment trying to find out who shot a guy in the head but have no luck. Back at the station, Ray is annoyed that no one can solve the mystery and that Jake manscaped with a tie. Jake and Charles go to Beneficio's where they reenact a scene in front of Ratko only for him to escape without them being able to catch him. Jake is assigned to the records room and is not happy about it at all. An annoyed Rosa approaches Charles who got tickets to all the movie to avoid making her mad but Rosa refuses to see a movie with him. Ray approaches Jake who is wearing a speedo and calls everyone in. At the stake out Ray comes out as gay but Jake thinks he's joking until he gets a flashback. Rosa gives Charles back his money but tells him she likes his company. Ray tells Amy and Jake that the NYPD was not ready for an openly gay detective but they gave him a second chance when the gold guard died out. Jake spots Ratko and the trio take chase. They enter the storage unit and Ratko thinks he's free until he's cornered by Jake, Ray, Charles, Rosa and Amy. Jake finally gets the tie joke when Ratko makes a break for it only to be tripped by Amy. The speedo then digs into Jake's backside and he walks away.
Jake's favorite pizza place burns down and he is determined to prove the owner was not responsible. Meanwhile, Amy is jealous of Rosa's being offered a promotion, and Terry and Gina have to hire a new IT specialist.
Jake tries to keep Charles from going "full Boyle" on his new girlfriend. Meanwhile, Rosa and Amy are reluctant to help an amateur caped crime fighter, and Holt faces competition for the presidency of a police organization he founded.
Due to his crippling debt, Jake faces losing his apartment, and asks Gina for help. Rosa and Charles clash with one of the weekend officers, and Holt and Terry ask their officers to conduct self-evaluations.
Jake tries to convince Charles to stand up to Vivian before the wedding, Terry struggles to stick to a diet after Amy and Gina give up, and Holt tries to get Rosa to make a sincere apology to an officer she offended.
Jake and Terry try to solve an apparently unsolvable case, Amy lies to Holt in order to dodge work and escape for a romantic weekend away, while Gina and Rosa introduce Charles to "Babylon", their secret bathroom.
Jake's latest investigation results in administrative leave, and, ultimately, his firing from the NYPD. Meanwhile, Charles goes into a funk after Vivian breaks up with him before their wedding, and the others try to cheer him up.