Identify an existing Account and convert lead to contact with a Custom Function

Identify an existing Account and convert lead to contact with a Custom Function

Hello everyone.

I'm trying to write a custom function in Zoho for the following scenario.

Any users or prospects that contact us are first created as a lead in Zoho CRM. When a lead is created, their company might already exist in the Accounts module. 

I need to search by lead's company name in the Accounts module, and if it already exists, convert the lead to a contact and associate them with that existing Account.

Is that possible? I'd greatly appreciate some help as I couldn't find any relevant info in the Learning Series nor in the guides.

Thanks!