Alan helps with a negotiation of a man with a gun holding his mother-in-law hostage. He gets home late and hears his wife Victoria complain about losing her license as a psychiatrist because of patient confidentiality.
The Mexican President is traveling by car, and tells his wife he can't make it to supper. He enters his mistress's apartment to find her tied up - and a gun to her head by the kidnapper.
Alan and Victoria go to counseling, where she admits to sleeping with her personal trainer Nico. Alan receives a call saying it's a "Code Pig", involving the President.
Police meanwhile evacuate all residents of the apartment complex saying it's a gas leak. Kidnapper calls and asks to speak to Alan only. He demands 30 million pesos in 30 minutes. He interrogates the President about broken promises during his tenure. Every time the kidnapper gets an unsatisfactory answer, he presses a button to shock the president.
Alan finally figures it out: the kidnapper is Vicente, who was a police shooter, and inadvertently shot a kidnapper with a grenade, killing a bus of hostages. Spent time in jail, blamed Alan. The person who signed the order to put Vicente in jail was the president. A video surfaces of Vicente's wife being sick with no healthcare and later dies.
Vicente requests a polygraph and records a video with president admitting to moving millions of dollars illegally. Vicente allows for a hostage release, which is Nico, who tells Alan that he was mugged and kidnapped. But Alan and Carrasco subdue Nico and find no injuries on his body - indicating that he is with the kidnappers. They also find the video of the President on his person.
Alan takes the help of his friend Charlie and enters the apartment where the President is held hostage and exchanges himself for his wife. He shows the video to Vicente and says he can make it go viral. Before Police enter, Vicente strikes a deal with the President - a year and a half in jail for releasing him.
Aftermath is that the video goes viral with 370 million views. Mexico chooses a new Interim president and there is social unrest.
Alan and Victoria are now together and give a talk on how marriage is not a hostage situation. Vicente, now a celebrity, calls Alan, saying the two of them could make a big difference for the country.