Aim. To compare the vaginal and endometrial microbiome in patients with cesarean scar niche (both in the presence of specific complaints of secondary infertility in combination with a niche with stagnant contents, and in the absence of such).
 Materials and methods. The prospective study included 67 female patients of reproductive age who had a uterine scar after caesarean section that met the inclusion criteria. Depending on the presence or absence of clinical complaints of secondary infertility, ultrasound and/or magnetic resonance imaging of the pelvic organs to visualize stagnant content in the projection of the niche, the patients were divided into two groups: group 1 (n=40) patients with secondary infertility in combination with stagnant contents in the projection of a niche (main group), group 2 (n=27) patients without clinical complaints, with a formed scar on the uterus, without signs of a niche (control group). All patients underwent a comparative study of the vaginal samples and the endometrial samples. The species and quantitative composition of the microbiome was analyzed using real-time polymerase chain reaction. Statistical research was carried out using the IBM SPSS Statistica v22 software (IBM Corp., USA).
 Results. Various microbiological communities were found in the analysis of samples of the vagina and endometrium in patients with stagnant content in the projection of the niche (group 1, main) and without it (group 2, control). Lactobacillus spp. was found most often in vaginal discharge samples (more than 50% of cases) both in group 1 and in group 2, however, their level was statistically significantly higher in group 2 (57.5 and 88.9%, respectively), p=0.005. When comparing endometrial samples from patients of groups 1 and 2, it was revealed that in group 1, in the presence of liquid content in the projection of a niche, opportunistic microorganisms were most often detected (more than 50% of cases): Enterobacteriaceae (65%) p0.0001, Streptococcus spp. (60%) p0.0001, Staphylococcus spp. (52.5%) p0.0001, and Gardnerella spp. (22.5%) p=0.0342 and there was a deficiency of Lactobacillus spp. (25%), on the contrary, in group 2, Lactobacillus spp. prevailed (66.7%) p=0.008. Comparative analysis of vaginal samples and endometrial samples of the niche projection in group 1 revealed the predominance (more than 50% of cases) of Lactobacillus spp. in the vagina (57.5%) p=0.003, on the contrary, in the uterine cavity there is a predominance of opportunistic microbiota, p0.001. Comparative analysis of vaginal samples and endometrial samples of the uterine cavity in group 2 revealed a statistically significant predominance of Lactobacillus spp. both in the vagina (88.9%) and in the uterine cavity (66.7%), p=0.0497. In patients with secondary infertility associated with the presence of stagnant content in the projection of the niche, compared with the control group, there was a higher alpha-diversity both in the samples of vaginal discharge (Shannon's index 2.0170.093 vs 1.0600.044; p=0.0120), and in endometrial samples (Shannon's index 3.4480.267 vs 1.0200.040, р=0.00008; Simpson's index 1.109 vs 0.003; p=0.00006). When analyzing beta-diversity, there were no statistically significant differences between groups.
 Conclusion. In the structure of the microbiome of the vagina and uterine cavity in women without scar defect on the uterus Lactobacillus spp. predominate. The presence of stagnant content in the projection of a niche is associated with an increase in the frequency and quantitative content of opportunistic microbiota of the uterine cavity, especially Enterobacteriaceae, Streptococcus spp., Staphylococcus spp., Gardnerella spp. Also, in patients with stagnant contents in the projection of the niche, a higher biodiversity was revealed both in the vaginal discharge samples and in the endometrial samples. These results highlight the importance of assessing the endometrial microbiome in women with cesarean section scar, especially those faced with the problem of secondary infertility.