Sending picture to elixir api in multipart/form-data as json parsing in api

Hey I am trying to send a picture to my api, and the api want an id and a user so this is how I am trying to send it:

selectPicture() {
      cropping: true
    }).then(image => {
      var bodyFormData = new FormData();
      var user = JSON.stringify({
        avatar: image[0]
      bodyFormData.append("user", user);
      bodyFormData.append("id", 1);

        method: "put",
        url: "http://xxxxxxx/api/user",
        data: bodyFormData,
        config: {
          headers: { "content-type": "multipart/form-data" }

not sure if this is the best way, so I would be open for suggestions
so we receive it in the update function that is waiting for these 2:

def update(conn, %{"id" => id, "user" => user_params})
but it seems like for one in the log of the api that there is no plug upload just this as user_params:.

params: %{
    "id" => "1",
    "user" => "{\"avatar\":{\"size\":117832,\"mime\":\"image/jpeg\",\"height\":960,\"width\":960,\"path\":\"file://

how could theis be parsed or worked around or done nicely?