A DOAC concentration threshold above which an impact on surgical hemostasis starts to occur is unknown. Thrombin generation assays (TGAs) provide a measure of the coagulation phenotype. This study aimed to determine whether preoperative TGA parameters are associated with postoperative bleeding, and whether this is partly due to residual DOAC levels. We conducted a nested case-control study using samples from apixaban/rivaroxaban-treated patients with atrial fibrillation from the PAUSE perioperative study. Cases were participants with postoperative major or clinically relevant non-major bleeding; controls were participants without bleeding. TGA parameters were measured using Calibrated Automated Thrombography (5 pM tissue factor). Generalized linear mixed models and causal mediation analyses were used to evaluate the relationship between DOAC levels, TGA parameters, and bleeding. Forty-eight cases were matched to 474 controls. Residual DOAC levels were higher in cases than controls (p = 0.03) and TGA parameters were correlated with residual DOAC levels (p < 0.05). A longer lag time (LT; OR = 1.319 per minute [95%CI 1.077-1.617]) and time-to-peak (TTP; OR = 1.154 per minute [95%CI 1.028-1.296]) were associated with an increased odds of bleeding; higher peak (OR = 0.994 per nM [95%CI 0.989-0.998]) and higher mean velocity rate index (mVRI; OR = 0.986 per nM/min [95%CI 0.976-0.996]) were associated with a lower odds of bleeding. The effect of apixaban/rivaroxaban levels on bleeding was mediated by altered TGA parameters (LT, TTP, peak, mVRI). TGA parameters are associated with postoperative bleeding and the impact of DOAC levels on bleeding is mediated by effects on thrombin generation.