Yes, you can use JavaScript Use-API, but it isn't easy to debug code, and it's server-side script.Instead, use Java API for add/update property in AEM.https://experienceleague.adobe.com/docs/experience-manager-learn/foundation/development/understand-java-api-best-practices.html?lang=en