Bile acids are essential for food digestion and nutrient absorption, but also act as signalling molecules involved in hepatobiliary diseases, gastrointestinal disorders and carcinogenesis. While many studies have focused on the genetic determinants of blood metabolites, research focusing specifically on genetic regulation of bile acids in the general population is currently lacking. Here we investigate the genetic architecture of primary and secondary bile acids in blood plasma, reporting associations with both common and rare variants. By performing genome-wide association analysis (GWAS) of plasma blood levels of 18 bile acids (N = 4923) we identify two significantly associated loci, a common variant mapping to SLCO1B1 (encoding a liver bilirubin and drug transporter) and a rare variant in PRKG1 (encoding soluble cyclic GMP-dependent protein kinase). For these loci, in the sex-stratified GWAS (N♂ = 820, N♀ = 1088), we observe sex-specific effects (SLCO1B1 β ♂ = -0.51, P = 2.30x10-13, β♀ = -0.3, P = 9.90x10-07; PRKG1 β ♂ = -0.18, P = 1.80x10-01, β ♀ = -0.79, P = 8.30x10-11), corroborating the contribution of sex to bile acid variability. Using gene-based aggregate tests and whole exome sequencing, we identify rare pLoF and missense variants potentially associated with bile acid levels in 3 genes (OR1G1, SART1 and SORCS2), some of which have been linked with liver diseases.