Had a period on 4/27 and two weeks after had light pink spotting and cramps and I have had unprotected sex during that time what could this be?

Irregular bleeding. Irregular periods are one of the most common problems obgyns treat. If this is one time problem it usually resolves on its own. If this is a recurring problem you should be evaluated. Infections & hormonal changes can cause spotting. If there is a concern for pregnancy then do a home pregnancy test . There are many options available to help regulate the menstrual cycle. Schedule a visit.