In this topic the author has the same problem:
because the file is created successfully, but it is untitled and has no format type, and the body contains this proprerties"
The solution in that topic was to add a header Content-Type with value application/json.
Try it, it might solve your problem.