How to apply labels to a member using the API?


I’m trying to use the member label functionality to give members a label, or even to remove a label, after they have already signed up. Ideally I would be able to have a form with a checkbox that would “subscribe” a user to a label.

The only code I’ve found that lets a user add a label to their own account is when it’s done for them on signup. Ideally we should be able to make these changes programmatically, either through the admin API, or through a front end helper when a member is logged in. But I can’t find anything in the documentation that would facilitate this.

You can add it by an input to any form like this:

<input data-members-label type="hidden" value="Early Adopters" />

and you can add or remove this using clientside JS if you want it to be optional :slight_smile: or dependent on context

So adding that to any form and submitting programmatically would just add the label?

What form would I add it to then if not to a signup form? The login form? Would I make a login form and just submit it to add a label?