Are you receiving SNAP/EBT benefits? The Expensify.org/SNAP-VAX campaign is live and accepting new members. Learn more about receiving $50 for submitting a SNAP receipt and $50 for getting your COVID-19 vaccine here and join today!

Issues in user removal from policy via API

Ashishxdsfdffg
Ashishxdsfdffg Expensify Customer Posts: 1

We are using Expensify API integration to remove users from a policy and it seems to somewhat work in that we get an appropriate user diff response and the users disappear from the policy in the website. But when we make an API call to get all employees under a policy, we still see the removed users.

These are the API calls we make -

To remove users from policy - as per  https://integrations.expensify.com/Integration-Server/doc/employeeUpdater.html#api-principles we send employee details with isTerminated flag true

data={
        "Employees":[
            { 
                "employeeID": "[email protected]", 
                "employeeEmail": "[email protected]",
                "policyID": "1234567ABCDEF", 
                "isTerminated": true
            }
]}

This does seem to remove the user from the policy on the website but when we try to get all employees in a policy by below API call, we can still see the removed user


API call payload format to get all users in a policy -

requestJobDescription={
    "type": "get",
    "credentials": ...,
    "inputSettings": {
        "type": "policy",
        "fields": ["employees"],
        "policyIDList": ["1234567ABCDEF"]
    }"

Is there some other way to just get the active employees? Is this the intended behavior of this API? To return all employees active/terminated?