Miscarriage and Sex

I had a chemical pregnancy and miscarriage about 8 days ago. Once the bleeding stops is it ok/safe to begin having sex again?