Send contact with API

Hi, this is my first time with ActiveCampaign API.

I have a custom form that is used to collect visitor data for a funnel and I need to understand how to send those data to the activecampaign lists.
I looked around the web a lot but I can’t understand how to do the javascript code …

Could someone show me the code to create a new contact and add it to the list?
Thank you

You can use v3 of our API to create a contact (https://developers.activecampaign.com/reference#create-a-contact-new) and add that contact to a list (https://developers.activecampaign.com/reference#update-list-status-for-contact). Hope this helps!