"Мій капелюх" is accepted.
If your answer wasn't accepted, it happened for some other reason. Maybe you put "моя", I wouldn't know. I cannot tell you for what reason because you didn't provide your answer here. Please always provide your full answer in the comment if you have a question about why it wasn't accepted.