How do I use Deluge to search a Ticket by its Account?

How do I use Deluge to search a Ticket by its Account?

Usecase: with Zoho Flow, my task is to filter Tickets in Zoho Desk based on a few criteria and then use that information to edit and invoice in Zoho Billing.

To achieve that, I'm using the Deluge search API to get all tickets from each Account (our clients) in a specific month.

As of the documentation, I should add a QUERY parameter, mapping the field I would like to search by to the searched value.

There are a few problems with that:
  1. Adding {"accountId" : "value"} to the query does not achieve what I need (I have no idea what the key should look like)
  2. Search only permits exact matches, how do I query a range for a Date field? Like Jan 2024 - Dec 2024 ?
I thought maybe this other function could help me, but then I would need all individual ticket IDs, which is exactly what I don't have access to: https://www.zoho.com/deluge/help/desk/fetch-related-record-by-id.html

Please help me on what to do.

This is my code right now:
  1. map get_last_month_diagnostics(string desk_account_id)
    {
    ORG_ID = "1264843";
    query = Map();
    query.put("accountId",desk_account_id);
    result = zoho.desk.getRecords(ORG_ID,"Tickets",1,5,query);
    sub_module = "Accounts";
    parent_module = "Tickets";
    result = zoho.desk.getRelatedRecordById(ORG_ID, sub_module, desk_account_id, parent_module, desk_account_id);
    info result;
    return Map();
    }