Preheat your oven to 400°F (200°C). Line a baking sheet with parchment paper or aluminum foil for easy cleanup.
Pat the chicken legs dry with paper towels to ensure crispy skin. Place them on the prepared baking sheet.
In a small bowl, combine the olive oil, salt, black pepper, garlic powder, onion powder, paprika, dried thyme, dried oregano, and red pepper flakes (if using). Mix well to form a paste.
Using a basting brush or your hands, coat each chicken leg thoroughly with the spice mixture, ensuring even coverage on all sides.
Arrange the chicken legs in a single layer on the baking sheet, making sure they are not touching each other. Bake in the preheated oven for 35-40 minutes, or until the internal temperature reaches 165°F (74°C) and the skin is crispy and golden brown.
Remove the chicken legs from the oven and let them rest for 5 minutes. Garnish with freshly chopped parsley before serving.
Serve the juicy baked chicken legs with your favorite side dishes, such as roasted vegetables, mashed potatoes, or a fresh salad.