This invention relates to new benzazepine carboxamide compounds of the formulawherein X and R1 to R6 are as defined in the description and in the claims, as well as pharmaceutically acceptable salts thereof. These compounds are TLR8 agonists and may therefore be useful as medicaments for the treatment of diseases such as cancer, autoimmune diseases, inflammation, sepsis, allergy, asthma, graft rejection, graft-versus-host disease, immunodeficiencies, and infectious diseases.