I want to create an application which is similar to this - A client (identified by user id) sends a REST API call to the server. The server queries database to check if this user has a badge before. If it has, it doesn't do anything. Otherwise, it marks in database that the user is granted the badge and it sends an email to the user.
PUT /user//badge/ POST /user//badge/
My question here is which http method should I use here? PUT or POST?
It is idempotent in the sense that email is sent in only the first request and subsequent requests don't do anything other than querying the db.
What http method do books recommend to be used in this case?