How to create a new collection entry via an API call?

Hey there,

I have a collection called “appointments” and a form in the frontend.
So now I would like to submit the form to the “save” API to create a new collection entry.

The documentation says:

fetch('/api/collections/save/posts?token=xxtokenxx', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
    data: {...}
})
})
.then(res=>res.json())
.then(entry => console.log(entry));

But it is not clearly specified what I need to submit as the “data”-object.
Additionally: What every I try to submit, the API answers with 404.

Thanks and I hope someone can help me with this.

Save a single entry:

fetch('/api/collections/save/collection_name?token=xxtokenxx', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
    data: {
        "title": "test"
    }
})
})
.then(res=>res.json())
.then(entry => console.log(entry));

Save one ore multiple entries:

fetch('/api/collections/save/collection_name?token=xxtokenxx', {
method: 'post',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
    data: [
        {
            "title": "test2"
        },
        {
            "title": "test3"
        }
    ]
})
})
.then(res=>res.json())
.then(entry => console.log(entry));