Personally did something similar - created posts in a custom post types in Wordpress based on Machform submissions.
Machform webhook --> Separate Script
The script takes the input from the Machform Webhook and publishes that to the REST API to do whatever you want it to do.
https://developer.wordpress.org/rest-api/reference/