Create Item from custom endpoint

Hey dear cockpit community,

I currently want to do the following:

Users have a form for submitting details
We want to recieve the data in a custom endpoint and then create collection entries from there

But I don’t find anything on how to create a new item for a collection with the cockpit function. Does anyone have an example (or link to the corresponding documentation) I can use?

Kind regards