A nanoporous composite film of poly-o-aminophenol (PoAP) and oxidized multiwalled carbon nanotubes (MWCNTs), which is electrochemically co-deposited on a stainless steel wire, has been synthesized. It was used as a new coating for direct immersion solid-phase microextraction (DI-SPME) of phthalate esters in various aqueous samples. In order to obtain an adherent, smooth and stable film, experimental parameters related to the coating process were optimized. These parameters include mode of electropolymerization, potential range, scan rate, the number of cycles, concentration of the monomer and oxidized MWCNTs. The coating was highly stable and extremely adherent to the surface of the steel fiber. The effects of various parameters on the efficiency of the SPME process consisting of desorption temperature, desorption time, extraction time, extraction temperature, ionic strength and pH were also studied. Under optimized conditions, detection limits for the phthalate esters varied between 0.03 and 0.08 ng mL−1. The intra-day and inter-day relative standard deviations for various phthalate esters at 1.0 ng mL−1 concentration level (N = 7) using a single fiber were 4.1–11.1% and 4.6–12.5%, respectively. The fiber-to-fiber RSD% (N = 3) was 6.5–13.1% at 1.0 ng mL−1. The method was linear at three orders of magnitude with correlation coefficients varying from 0.9878 to 0.9995. The method was successfully applied to the analysis of bottled mineral water samples and three injectable infusion solutions with recoveries from 91 to 115%.