I’d have to check on the backend. I agree it is a strange discrepancy that you can upload GIFs (I presume only single-frame?) via the web. It is perfectly possible that this is not supported on the API endpoint, in which case this is something we should make clear in the documentation.
(I think the comment over on Github about what is possibly happening is likely to be the case, to be fair)