Genesys Cloud - Developer Community!

 View Only

Sign Up

Expand all | Collapse all

API calls that will only list the users from the same division

  • 1.  API calls that will only list the users from the same division

    Posted 10-09-2025 11:00
    Edited by Ekaterina Romanova 10-09-2025 11:00

    Hello everyone!

    My customer was trying to find an option to restrict the use of the GET /api/v2/users API request per division.

    I found that the required API call doesn't have a division filter. It only has an active/inactive filter.

    Does anybody have any ideas about what could be done by the customer, or know of any API calls that will only list the users from the same division?


    #PlatformAPI

    ------------------------------
    Ekaterina Romanova
    Technical Account Manager
    ------------------------------



  • 2.  RE: API calls that will only list the users from the same division

    Posted 10-09-2025 11:49

    Hello,

    They can use the POST /api/v2/users/search endpoint with a body like this:

    {
      "sortOrder": "ASC",
      "pageSize": 50,
      "pageNumber": 1,
      "sortBy": "id",
      "query": [
        {
          "operator": "AND",
          "type": "EXACT",
          "fields": [
            "state"
          ],
          "values": [
            "active",
            "inactive"
          ]
        },
        {
          "operator": "AND",
          "type": "EXACT",
          "fields": [
            "divisionId"
          ],
          "value": "ID-OF-THE-DIVISION-TO-USE-IN-FILTER"
        }
      ]
    }

    If they only want active users, they can remove "inactive" entry from the first filter.

    And define the division id in the second filter ("ID-OF-THE-DIVISION-TO-USE-IN-FILTER").

    Regards,



    ------------------------------
    Jerome Saint-Marc
    Senior Development Support Engineer
    ------------------------------