Preheat your air fryer to 325 and prep your liners for nonstick. If you are using paper liners, you can place them into ramekins for wall support.
In a medium mixing bowl, use a whisk to mix together the flour, sugar, unsweetened cocoa powder, baking powder, baking soda, and optional espresso powder.
Next, in a large mixing bowl, combine together the buttermilk, vegetable oil, eggs, and vanilla extract. Mix these ingredients until well combined.
Add the dry ingredients from the first bowl to the wet ingredients in the large mixing bowl, scraping down the sides of the bowl as needed. Mix these ingredients until just combined as overmixing can affect the texture of the cupcakes.
Lastly, carefully and gradually add the boiling water to the batter using a whisk to blend it in.
Use a cookie scoop or similar item to fill your prepared cupcake liners three fourths of the way full. Then loosely cover each cupcake with foil.
Air fry the cupcakes for eight minutes, carefully remove the foil, and continue to air fry for another two to four minutes or until a toothpick inserted into the center comes out clean.
Let the cupcakes cool on a cooling rack before serving or frosting.