Patching a user's information using the API results in a 405 error

Using the PatchUsers method returns an HTTP 405 error code.
Any clues?

Hi Lanhild,

HTTP 405 means “Method not allowed” and usually refers to the HTTP method used when sending the payload. What HTTP method did you use? Although not explicitly mentioned in the documentation, I think you need to use the PATCH method with this endpoint. Did you maybe use POST or PUT?

I used the PUT method, as specified in the documentation. I think though there might be a typo in the docs since using PUT to ‘patch’ a user’s information doesn’t make much sense. Anyways, using the PATCH method still results in the same error.

NOTA: My credentials are correct and do have the appropriate permissions.

PUT is OK, I just tried it on my system, so the documentation is correct.
See this example:

# curl -sX GET -H "Authorization: Bearer <MYTOKEN>" "https://mydomain.tld/api/v4/users/ob8fn4u3p7d1iyyid7heut9mtr" | jq -r .nickname
test

# curl -sX PUT -H "Authorization: Bearer <MYTOKEN>" -H "Content-type: application/json" -d '{ "nickname": "newvalue" }' "https://mydomain.tld/api/v4/users/ob8fn4u3p7d1iyyid7heut9mtr/patch" | jq -r .nickname
newvalue

# curl -sX GET -H "Authorization: Bearer <MYTOKEN>" "https://mydomain.tld/api/v4/users/ob8fn4u3p7d1iyyid7heut9mtr" | jq -r .nickname
newvalue
1 Like

Thanks, seems like somehow my curl binary didn’t pass the method correctly

Alright, thanks for confirming the solution.