This endpoint allows you to create a new resource in any collection. For example, the "todos" collection can be used to add a new to-do item. Every collection in your application can be used in the same way by replacing "todos" with the desired collection name. To use this endpoint, send a POST request to /todos with the data you want to create.
POST /todos
{
"title": "Buy groceries"
}
The request body should contain valid data based on the config.json file for the specific collection. Once the resource is successfully created, a response with the newly created resource will be returned.Ensure that the user has the necessary permissions to create a resource in the specified collection. The permissions are defined in the config.json file.
You can control which properties users are allowed to include in the request body by defining permissions in config.json. The pick option specifies a list of allowed properties, and any property not listed will be ignored. The omit option specifies a list of disallowed properties, and any property listed will be removed from the request before processing.
{
"permissions": {
"user": {
"pick": ["title", "description"],
"omit": ["user"]
}
},
"schema": {
"title": { "type": "string" },
"description": { "type": "string" },
"user": { "type": "string" }
}
}