REST API POST response is always flagged as error despite an HTTP 200-OK response code

I am sending a POST HTTP request from Retool to an API backend on our own infrastructure. When the request fails, I get the proper error notification setup here:

When the request succeeds (i.e. we send a 200-OK HTTP code in the response), I always get a message that the query failed, but the query resource .data attribute has the response body:

I tried both: the event handler on success doesn't fire nor the "Show notification on Success":

This is the ngrok displaying that same request success:

I must be missing something because it seems to me this is pretty straightforward and must be used by everyone. Will appreciate any pointers.

Hi @Carlos_Gonzalez,

Are you sure the status is coming back as data.statusCode and not simply data.status, in your failure conditions?

Hey Mike!

Thanks for your pointer: I was not sure if data.statusCode was the right one and actually, it was not :man_facepalming:

I tried data.status and was undefined, but metadata.status was the right one to use. Thank you so much for your help :raised_hands: