Editing Joplin .md files directly does not update app contents

Following up on the response: how does the API work if I want to replace text in a note? For instance, in your PowerShell example, you get the body of a note into a variable $body. I want to then do a command like:

$new_body = $body -replace "to be replaced", "replacement string"

and then write new_body as the contents of the old body (for instance, replace TODO with DONE.

I saw in the Joplin API (joplin/api.md at master · laurent22/joplin · GitHub) that I need to use PUT, but the instructions are unclear as to how to make a working function call. Seems someone has used POST with PowerShell before here, but not PUT.

Any help or clarifications would be appreciated!