Using REST API to opt in emails

We are trying to get the REST API to opt in email addresses when the user checks an opt in checkbox on our form. All answers that i have found on here are about 2 years old and say that they are working on it. Anyone have an idea of how this is coming along?!/Contact/createContactUsingPOST!/Contact/updatePropertiesOnContactUsingPATCH_1

You may opt-in or mark a Contact as Marketable by including the following field in the request JSON with an opt-in reason. (This field is also shown in the complete request body sample.) The reason you provide here will help with compliance. Example reasons: "Customer opted-in through webform", "Contact gave explicit permission."

Thank you Tom I think we have the creation sorted. Just need to work on updating if they submit the form a second time using that second link.

Hi Tom
Can you please tell me if it’s possible to use opt_in_reason with Rest v2
because isn’t documented on v2 specification @

I can see now that in rest v2, field opt_in_reason is available on every email address of a contact.

Yes, one of the changes with the v2 API is to clearly show which email addresses of a Contact are opted-in and which are opted-out. You can set the opt_in_reason value along with each EmailAddressRequest either on creation or update of a Contact.

Note that if any of a given Contact’s email addresses are opted-out, the Contact will be Non-Marketable.

1 Like


Hi Tom,
Does the V1 API for contact work for email?
I am getting the same email_status and opt_in_reason for all contacts.
Do I have to use the V2 API?
If so can I use the same token I use when I access the V1?

Thank you

Yes, you can build on the V1 API using the same token.

Thank you Tom. I was able to call the V2 API and retrieve the email addresses for a contact along with the opt in status etc but I am having trouble getting to the next page of data. How do I use the next_page_token?

That point might be irrelevant because I also don’t see a way to figure out when the email address was opted out. For example, I know of a user that eventually opted out thier email address but in the data from the API v2 I see the first email status when they were opted in.

Is there a way to get the Email Status table that I see in the other documentation ( EmailAddStatus).

Your help is greatly appreciated