How to add a tag to a note via the API

I am trying to use the API to add a tag to a note but facing some issues.

I'm seeing this in the console

Uncaught (in promise) Error: Missing note ID
    at Object.<anonymous> (C:\dev\joplin\packages\lib\services\rest\routes\tags.js:29)
    at Generator.next (<anonymous>)
    at fulfilled (C:\dev\joplin\packages\lib\services\rest\routes\tags.js:5)

But the command itself does contain the note id:

The API doc isn't very helpful here either

POST /tags/:id/notes

Post a note to this endpoint to add the tag to the note. The note data must at least contain an ID property (all other properties will be ignored).

This is how I call the API:

				await joplin.data.post(['tags', message.tag.id, 'notes'], null, {
					note: {
						id: noteId
					},
				});

Appreciate any advice.

As an aside, what's the point of using a typed language if you end up with a bunch of any's:

post(path: Path, query?: any, body?: any, files?: any[]): Promise<any>;

Ok, nevermind, figured this out. It should be

await joplin.data.post(['tags', message.tag.id, 'notes'], null, {
	id: noteId
});

Oh the joy of dynamic typing!

Pull requests are welcome if you've identified things that can be improved.