splitwise/api-docs

Change Update User endpoint from POST to PATCH (or PUT)

Kore-rep opened this issue · 1 comments

POST is used to create a resource, so theoretically if I try to post a specific user ID, I should receive a 409 Conflict error code. Instead the endpoint should be a PATCH operation (which only requires fields that are being updated to be sent) or if you have something against PATCH, a PUT (which requires the entire object to be sent (even fields which aren't being updated).

Currently it seems the endpoint is behaving as a PATCH endpoint (with a POST verb) anyway.

Additionally you could consider updating the Delete a group endpoint to a DELETE verb

jas14 commented

Hi @Kore-rep , thanks for the feedback. I agree, our routing and HTTP verb usage (among other things) could be improved! We've identified a wish-list of such changes internally, e.g. changing POST /delete_group to DELETE /groups/:id.

Whenever these new endpoint(s) become publicly available, we'll certainly update our documentation. They'll almost certainly be under a new API version! In the meantime, I'm going to close this as "not planned," since we have no concrete timeline for these changes.