run wordpress function – update_post_meta() inside ajax

I have ajax script to send form, I want to additionally run update_post_meta() function if success. I assume I can do this in ajax_response.php file, but this is not wordpress file, so wordpress functions don’t work there.
Which way is better to run this script, inside this ajax script (below), or somehow in ajax_response.php (but how initialize wordpress in this file?)
Script below is inside wordpress page.

$('#postForm').submit(function(e) {
           e.preventDefault();
           grecaptcha.ready(function () {
               grecaptcha.execute('6Lcg9l8jAAAAAAp4KIczCJ8N_xkOezJt7LngYVgu', { action: 'submit' }).then(function (token) {

            $("#googleResponse").val(token);
        
           $.ajax({
                   url: '/wp-content/themes/zaproszenie/ajax_response.php',
                   type: 'post',
                   data: $('#postForm').serialize(),
                   dataType: 'json',
                   success: function(data){
                       if(data.response == 'success')
                       {
                            $("#response").css('border','1px solid green');
                            $("#response").css('background','#ffffff');
                            $("#response").text(data.msg);
                       }
                       else
                       {
                           $("#response").css('border','1px solid red');
                           $("#response").css('background','#ffffff');
                           $("#response").text(data.msg);
                       }
                   }
            });
        });
    });
});