How to send a top-level JSON array in a Retool REST API query?

Hi all,

I’m trying to send a POST request from Retool where the API expects a top-level JSON array of objects. For example:

[
  {
    "userId": "8efd2fc1-b1ae-463d-af09-138128b598d1",
    "newCompanyId": "a1b14c94-e9e3-4c01-9932-bd1c7fc97654",
    "planId": "16e5e9c3-23ac-46e5-b1ee-9d4dd5d217a3",
    "balance": "500"
  }
]

What I’ve tried so far:

  • Raw JSON body → Retool sends it as a string ("[{…}]").
  • JSON (form) with blank key → Retool sends {}.
  • JavaScript (object) → even something simple like [{ test: "hello" }] ends up as {} in the request logs.

Logs confirm the request.body is always {}, [], or a quoted string — but never the array itself.

If I hit the same endpoint with curl or Apidog using the JSON above, it works fine. For example:

curl -X POST "https://example.com/backoffice/users/change-company" \
  -H "Content-Type: application/json" \
  -d '[{"userId":"123","newCompanyId":"456","planId":"789","balance":"500"}]'

This works outside Retool, but I can’t get Retool to send it correctly.

How can I send a top-level JSON array from Retool? Is this a known limitation or am I missing a specific body type setting?

I figured out how to get this working, so posting here in case anyone else runs into the same problem.

The issue was that Retool doesn’t handle top-level arrays well in the JSON or JavaScript body modes. It either sends {}, or wraps the array in quotes and turns it into a string.

What worked:

  • Change the request body type to Raw.
  • Write your JSON array directly in the body, for example:
[
  {
    "foo": {{ textInput1.value }},
    "bar": {{ numberInput1.value }}
  }
]
  • In the Headers section, add:
content-type: application/json

(all lowercase, with a normal hyphen – Retool rejects it otherwise).

After that, the request body in the “Actual Request” tab shows up exactly as an array instead of {} or a string, and the API accepts it.

Hope this helps anyone stuck on sending arrays with Retool REST API queries.

Hi @guilimasp, glad you were able to figure this out and thanks for posting the solution!