Lets consider a REST API for a backend application that does not have any DDBB dependencies or connections.
For example, a python backend app which uses a machine learning model binary that takes a complex JSON and outputs a probability.
I want to create a new endpoint for this API. This endpoint will expect a body payload in JSON, but it will not create any resource. It will take the data, process it using the machine learning model and send back an answer with the probability.
REST API's good practices and design documentation seem to only consider the REST API as resource-oriented, for example the 4 main methods (GET, POST, PUT, DELETE) are directly related to the CRUD operations.
But, what method should I choose in this case?
I would say a GET, but is not a posibility because I need to ingest a JSON body in the input. A POST does not seem adequate neither, because I am not creating any resource.
If your API doesn't represent entity management, it's not a REST API in the classic sense of the definition, and you should not strictly stick to REST's conventions.
I'd use a POST request that gets and returns a JSON.