Check with your local Building Department. You may get 10 different answers here, but when you go to sell, you may have to change it.
Normal construction for bedrooms is 2'6" or 30" wide.
Usually a narrower door is to a bathroom or utility closet, linen closet, etc.
Make sure it meets your local egress (escape) code, as that is your primary escape route. Be safe, G