Changing column order via API

Hi all!

First post here so forgive me if I get this wrong. I'm trying to update the column order for a table via this api, PUT /api/table/:id/fields/order api docs here

I keep getting the same error "field_order": "value must be an array. Each value must be an integer greater than zero."

But can't see anything wrong in the request (I've got other requests working fine so not an auth problem)

Params being passed in via the body of the request

    "field_order": [1,2,3]

Docs aren't clear on what these ints represent or anything else about the request so any help would be much appreciated.

Our database is Mongo DB in case that makes any difference.


Hi @boz
You're likely seeing this issue: - upvote by clicking :+1: on the first post

The best way to learn the API, is to just use Metabase while having your browser developer Network-tab open and looking at the request, and what data is being send/received.

Hi @flamber I have the same issue when using the API with me getting error 400 with the same error referring to an array of integers. However, I can move columns just fine with custom ordering within the UI, so I am unsure if I have the same issue you have linked to in git or a different issue? i.e. custom ordering works and status code is 200 when using the UI.

My database is also mongodb.

via UI


via API

@jayharan Try doing the change in the GUI and copy the request as cURL or Fetch, since there's most likely something different from your code.