Passed out in the middle of sex?

My boyfriend and I were having sex. Missionary. Nothing too crazy. Everything was going perfectly but then, and I don’t remember this, but he said I told him I couldn’t see. So he stopped and then I just passed out and wouldn’t respond to him. He said I woke up a few minutes later as he was about to call for an ambulance. I’m not sure what happened. Has this happened to anyone else before? I feel fine now but I do have a bit of a headache. It happened two hours or so ago. I’ve been drinking water so I know I’m not dehydrated. Thanks