Set contacts as marketing 'on demand'

How can I set contacts as marketing ‘on demand’ using the API or any other hubspot tool?

For example, we might have many contacts but only some of them are interested in the newsletter. When the user clicks subscribe to newsletter on our website we want to set the contact as marketing using the API / hubspot form / open link to another page where he confirms this.

How can I achieve this?

Hey @Ran-ST, you can do this a few different ways, the first with a workflow:

  1. Form submission
  2. Set as Marketing contact

Or you can use the CRM API by updating the property, “hs_marketable_status” to “true”.

Hope this helps!

Thanks! Setting hs_marketable_status using the api has all the limitations as doing it in any other way such as setting in the same month to marketing and then non marketing?

Yes @Ran-ST, that’s correct!

I get the following error:

{
 "status": "error",
 "message": "Property values were not valid: [{\"isValid\":false,\"message\":\"\\\"hs_marketable_status\\\" is a read only property; its value cannot be set.\",\"error\":\"READ_ONLY_VALUE\",\"name\":\"hs_marketable_status\"}]",
 "correlationId": "70651ddb-b37b-4eb7-925c-b905e496cad9",
 "category": "VALIDATION_ERROR"
}

Can you please let me know what to fix or elaborate on the forms solution?

Hey @Ran-ST,

So sorry about that! I thought this was accessible via API. Turns out there’s still just an idea here. As for the form, do you have access to Workflows?

I do not have access to Workflows or Automation

Ah okay @Ran-ST, you could also set this up to auto-set these to Marketing Contacts in that case. Scroll to the “Set contacts created by API key apps as marketing contacts” section.

This will set all contacts but I need to do it programmatically in response to a user request. Is there any other way?

Hmm, workflows is the easiest way. But if you’re already working with the API, maybe you create a form that you submit contacts to when they want to subscribe? HubSpot forms have the ability to set as a marketing contact upon submission which is what you would be doing with the Forms API.

I think we’ll be working with the automation /workflows after all.

Thanks!

I thought of this option and if I remember correctly, in order to set contacts created as marketing, you must enable captcha - and then the form can’t be used with the API.