Filter API result by nested field


I’m downloading a list of approvals: /api/v2/workflow_approvals/
I want to filter by the user who launched the request. If I look at the json it’s in this field:

I can’t figure out how to filter on this.

Any tips?

Is there more information needed from my side?

Here’s a screenshot of a part of the response. I want to narrow down on the name (here donald_duck).

Screenshot 2024-05-29 at 08.56.28

Hi !
If i well understood you basically need to parse a JSON data in a file right ?

If yes you can basically use something like read JSON file then parse it , have a look to :


No sorry. I don’t want to parse a JSON file.
I want to do an API access to the /api/v2/workflow_approvals/ endpoint.
One could specify filters at the end of the URL to narrow down the results.
The results consist of a JSON file. There are top level fields and nested fields.
E.g. status is a top level field and I could filter using something like /api/v2/workflow_approvals/?status=pending.
But I want to filter for a certain user. But the user name is a nested field (see screenshot above). So I don’t know how to specify it in the API query.

Ok sorry me for the previous misunderstood :slight_smile:
I had a quick look at the API reference but it seems there’s no native way to do it.

Depends on what you’re trying to do, why don’t you store the API call result you got somewhere in a variable, and then parse it as a json file/result and then, launch api calls on condition for instance ?

I mean as API doesn’t seems to have the option, so store data you need and filtering then in a second time


use the ?order_by=name but i assume it’s workflow’s name, not user.

Hi, thanks for coming back. I just wasn’t sure if it’s possible or not. At the moment I’m downloading the result and parsing it offline. Of course it would be better if I could only get the result I need by filtering it already in the API call.
So it’s not possible, right?

According to the documentation, i think it’s not possible yet, unfortunately.

1 Like

On the contrary, this is possible.

If you browse to /api/v2/workflow_approvals/ on your instance, and click the “options” button, it will show you the valid search_fields and related_search_fields. You can search nested values of valid objects using double underscores.

So for example, you can use this to filter all approved/denied workflows by a given username:
or by id /api/v2/workflow_approvals/?approved_or_denied_by__id=2

Similarly, if you’re wanting pending approvals launched by a particular user:


Hi, thank you very much!