"A Crystal of Time (The School for Good and Evil Book Five)" by Soman Chainani
"A false king has seized Camelot’s throne, sentencing Tedros, the true king, to death. While Agatha, narrowly escapes the same fate, Sophie is caught in King Rhian’s trap. With her wedding to Rhian approaching, she’s forced to play a dangerous game as her friends’ lives hang in the balance.
All the while, King Rhian’s dark plans for Camelot are taking shape. Now the students of the School for Good and Evil must find a way to restore Tedros to the throne before their stories—and the future of the Endless Woods—are rewritten . . . forever."