When you have sleep apnea, your breathing is interrupted during sleep. This can lead to oxygen deprivation, which can trigger a headache in the morning.