I was not present at that moment, so I can't judge the situation. And I know neither you, nor your boyfriend. I don't know much about your relationship either. So I have to write out of the blue here.
It's good you have a safe word, or safe phrase.
Being slapped in the face can be dangerous though from a medical viewpoint. If he accidentally slaps your ears, the worst outcome can be that your ear-drum gets broken. Which is no fun.
I also worry about that it was out of the blue and not inmidst of a role-play. I don't mind "surprises" coming up during a role-play, but even then, it should be discussed before if surprises are okay. And "surprises" are not okay for everyone. And outside a role-play, this should be agreed on before.
I'm into BDSM, but not the varieties which rock your boat. However,
I know a lot of other BDSM people and for them, spanking a butt is very different from slapping someone into their face. The latter being much more intense psychologically and carrying a risk that the partner might react badly, cry, break down etc. It's a very intense play which some of the BDSM people enjoy a lot, but they all say - you need trust beforehand, it's risky etc. But then again, many BDSM people seem to like things which are psychologically risky and sexually, they enjoy things which are a mix of "feels good" and "feels bad", or the adrenaline rush, and especially the balance act involved with dealing with contradictory sensations or feelings. I think the sexual kick of a balance act is the common denominator for many BDSM people.
So this is why I wonder your boyfriend did this to you. Either he does not care, or he does not know it may turn out being not okay... I don't know if he's a jerk, if he lacks experience concerning BDSM scenarios, or if he has a great intuition and just got the feeling right that it was okay for you then, at this moment, in this situation, to do exactly this.
I'd suggest go on having fun, but talk about both your limits and taboos. Be right-away about it. Be clear. Be honest (to yourself and your partner). You cannot engage safely into BDSM sex without being clear about your limits. "Normal" sex may get just disappointing if you're not honest before, but BDSM sex may become traumatic even without your partner wanting to inflict a trauma on you. And be careful, what he did might just have been clumsy (even though it was okay for you right then) or he thought it was okay for you or he doesn't care about how you feel. Plus learn about physical risks, e. g. slapping the face is risky.
I'd suggest you to go to the BDSM scene and get advice from experienced BDSM people about physical and psychological safety. As your report reads like you're both new to this subject and experimenting and having fun, but you lack the information or experience to be aware of the risks. BDSM people are good to talk to for these things. Maybe your boyfriend is a jerk, maybe he is a great guy but a BDSM top lacking experience and therefore he plays dangerously.
You might also want to buy a good book about BDSM and safety, for the medical etc. aspects. Cause bondage, flagellation etc. can be great fun if you're into it, but if you don't know much about the technique and risks, you may damage kidneys etc.
I mean, I'm into bondage and this sounds harmless. But until I got good advice from the BDSM scene and BDSM safety books, I got into medical trouble over and over again. Like, e. g. damaging nerves of my hand so that I had no feeling apart from an ant-like prickle in two of my digits for a couple of months. Just because we used the wrong material for bondage and my partner made the knots at the wrong place so that it damaged a nerve on my wrist. As when the situation gets hot during sex, you tend to fight with the ropes and put much pressure against them etc. Thanks God nothing worse happened, I could have strangled myself to death with ropes applied wrongly.
Flagellation stuff such as spanking etc. can be even much riskier if you don't know the medical aspects and which parts of the body are taboo there - you can wreck kidneys etc. I have a great book about it, but it's in German, so ask for good advice from a local BDSM group or buy a good book about it.
BDSM is one of the most interesting and thrilling experiences of human sexuality, but it's risky at the same time.
So take care of yourself! And enjoy yourself!