Preheat your oven to 375°F (190°C).
In a large bowl, season the chicken thighs with salt, black pepper, ground cumin, ground cinnamon, and ground allspice. Rub the spices into the chicken pieces.
Heat olive oil in a large skillet over medium-high heat. Add the chicken thighs and sear until golden brown on both sides. Remove the chicken from the skillet and set aside.
In the same skillet, add the sliced onions and cook over medium heat until they are softened and caramelized, about 10-12 minutes.
Stir in the sumac and cook for an additional 2-3 minutes.
Spread the caramelized onion mixture evenly over the bottom of a large baking dish.
Arrange the seared chicken thighs on top of the onions.
If using pine nuts, sprinkle them over the chicken.
Bake in the preheated oven for 30-35 minutes, or until the chicken is fully cooked and tender.
Toast the flatbreads or pita bread in the oven for a few minutes until warm and slightly crispy.
To serve, place the warm flatbread on a plate, and spoon the onion mixture and chicken on top.
Garnish with chopped fresh parsley.
Enjoy your meal!