System error: -2147012890 Bad gateway Error code 502?

I was using the API to post an image to Cloudflare and received the following return code:
System error: -2147012890

Does anyone know what this error means? It was accompanied by the following:
Bad gateway Error code 502

I was posting several images as part of an automated script if that’s of any relevance?