I'm sending a post request from flutter to a custom route in Strapi, which is inserting data to Postgres database using knex.js (working fine). I would like to access webhooks from the code and be able to send the request to Zapier.
I've noticed that webhooks work when using Strapi's ui administration panel to insert the data to the db through there (but I can't use that, as the front-end will be in flutter).
I've searched the docs, but couldn't manage to find anything on custom webhooks - only on the default usage of webhooks through content creation through the Strapi admin panel.
What I understand is that you want to send a request to zapier after the data has been inserted to the database.
In that case I would use lifecycle hooks - Probably the lifecycle hook afterCreate should do the job.
https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks The lifecycle hooks are functions that get triggered when the Strapi queries are called. They will get triggered automatically when you manage your content in the Admin Panel or when you develop custom code using queries·