does api /communication-preferences/v3/subscribe invoke double opt-in?

Does the API endpoint, /communication-preferences/v3/subscribe, invoke the double opt-in email for subscriptions set to use double opt-in through settings?

If it does not, how can a double opt-in be acheived using the API?

I have the exact same question.

I’m using the official PHP package to create a contact with API V3:

$hubspot->crm()->contacts()->basicApi()->create(new SimplePublicObjectInput([
'properties' => $properties
]));

and need this process to send the double opt-in email. I have double opt-in enabled on HS.

In API V2 we would submit a “Form” via api like this:

$response = $hubspot->forms()->submit($portal_id, $form_id, ...)

appending a ‘legalConsentOptions’.

How can we replicate that?

It seems V2 no longer works and I’m forced to create a “Private App” with a new API Key.

The problem is that the functionality has been lost or the documentation is lacking.

Here a reply received from HubSpot support on this.

I understand, so the question basically was if when a contact is subscribed via an API if they then get the DOI email? If that is the case, the contact would not receive the email because the DOI is also not tied to subscriptions. If you have the DOI feature enabled contacts will automatically get the email once the submitted a form but not because they subscribed.

So it seems only through their forms. There is the api endpoints to submit to a form, e.g. `

https://api.hsforms.com/submissions/v3/integration/submit/`. We may try this route

Do you have a docs page to that endpoint?

Like this one: Accounts Dashboard | HubSpot but for form submissions?

No I do not. I believe we got the end point from the form when creating it. I did find this via googling: https://legacydocs.hubspot.com/docs/methods/forms/submit_form

I personally find it very confusing that there are “legacy docs” and v3 docs, with much of the “legacy docs” still active and important. :person_shrugging:‍