It seems that the API endpoint PATCH /resources/{id} requires an ID as part of the URL path, which is the correct and standard approach for updating a specific resource. If you want to update a resource based on another field (e.g., field=X), it is not a standard RESTful approach to use the PATCH method.
Use GET with a query parameter: You could use a GET request to retrieve the resource ID based on the field value, and then use that ID to make a subsequent PATCH request.
Example: GET /resources?field=X to get the resource ID, then PATCH /resources/{id} with the updated data.
Use POST: If the PATCH method with an alternative field is not supported, and you cannot retrieve the resource ID beforehand, you can use the POST method to trigger the update based on the provided field.
Example: POST /resources?field=X with the updated data in the request body.
However, it's important to note that using POST for updates might not follow the strict RESTful conventions, but it can still be a valid approach when the standard PATCH method cannot be used.