How to upload image using Discourse API

Did you get this to work? I have been trying all manner of combinations with Node.js, and cannot get this to work.

I get a 422 Unprocessable Entity error.

In the Discourse docs, it says the content-type for the request is application/json.

In this post, the Postman example is using form-data, and when I watch the composer in the Discourse Web UI, it uses a multi-part post.

Anyone know how to do this via the API without using the Ruby client?