Preheat the air fryer to 400°F (200°C).
Rinse the chicken drumsticks under cold water and pat them dry with paper towels.
In a mixing bowl, combine the olive oil, salt, black pepper, garlic powder, onion powder, smoked paprika, and cayenne pepper (if using).
Add the chicken drumsticks to the bowl and use your hands or a basting brush to coat them evenly with the spice mixture.
Place the coated drumsticks in the air fryer basket, making sure they are not overcrowded. You may need to do this in batches, depending on the size of your air fryer.
Cook the drumsticks for 25-30 minutes, turning them halfway through the cooking process. They should reach an internal temperature of 165°F (74°C).
Once cooked, remove the drumsticks from the air fryer with tongs and let them rest for a few minutes.
Serve hot, garnished with fresh parsley if desired.