This article is a good basis: https://css-tricks.com/headless-form-submission-with-the-wordpress-rest-api/
Warning
As of 5.8, CF7 introduced a hash-based id.
sources: https://contactform7.com/2023/08/06/contact-form-7-58/#hash-based-contact-form-identification
You'll have to use the post_id of a form as <FORM_ID> for the api endpoints:
https://your-site.tld/wp-json/contact-form-7/v1/contact-forms/<FORM_ID>/feedback
This unhashed-id is found in the URL of the editing page of a form:
<SITE_URL>/wp-admin/admin.php?page=wpcf7&post=<UNHASHED_FORM_ID>&action=edit
The rest of the article should work 🤘
sources : https://www.timber-dev.net/how-to-submit-contact-form-7-via-api-with-headless-wordpress-using-html-and-vanilla-javascript/ https://contactform7.com/2015/03/28/custom-validation/ rocklobster-in/contact-form-7#1366 https://wordpress.org/support/topic/please-help-with-rest-api-not-work/