We are building a site with a login (nothing to do with hubspot) and there has been a request for users to be able to manage there newsletter subscription on the my account page. Subscription status being something stored in hubspot.
It's not possible to opt-in an email address that has previously opted out via the API. This is to help prevent abuse by parties trying to opt in contacts that do not want to be opted back in. You can allow contacts to opt out of email types via a custom subscription page, but to opt back in contacts would need to navigate to the default HubSpot subscription page.