I'm working on building a REST API and I'm not too sure what the correct way is to represent an endpoint that generates data. Assuming the ressource is about "items", I have the usual endpoints:
- GET /items => list items
- POST /items => create a new item
- GET /items/{id} => get an existing item
- PUT /items/{id} => update an existing item
- DELETE /items/{id} => delete an existing item
Now, I also have a process that can generate items based on some parameters or configuration in the system. What is the correct way to define this endpoint with REST?
I am tempted to use also POST /items but this one is already taken to create a "single" new item. Is is correct to sometimes use:
- POST /items?from=2020-07-15&to=2020-07-21 for with no body => this creates a list of items
- POST /items with an item in the body => this creates a single item
Thanks for your input!