Missing Policy Delete, Policy Rename API/Documentation

In the full documentation there is no discussion around a Delete Policy method. Is it truly absent from the public API?
I notice when using the Expensify web UI, deleting a policy invokes another API, for which I do not see any documentation. As a curl call it looks something like this:
Are there plans to make this additional API publicly available, and/or are there plans to add additional functionality to the existing current API?
Same question applies for renaming existing policies. This isn't an option in the public Policy Updater function today but IMO should be.
Answers
-
As pointed out in another thread, API endpoint to Close employees that left the company, we also cannot remove/deactivate Employees using the API, which is problematic to really automate the flows I'm working on right now.
-
@matthewpoer Unfortunately, deleting a policy is also not available via the API, there are a lot of factors that are involved in deleting a policy, the primary of which is billing. Because billing is based off of active policy use, we were not able to add this as a function of the API. Deleting a policy also affects data across the accounts of all users invited to the policy. We didn't include anything in the API that could negatively affect individual user accounts.
-
@Nicole Trepanier thanks very much for your response. I don't fully understand though. As a user of the API, I expect to be able to programmatically accomplish any task that a web user could point-and-click through. Are there conditions under which a web user would not be able to delete a Policy?
-
@matthewpoer Policies cannot be deleted under a few conditions. A couple of cases are when there are reports on the policy still in processing or if the policy is set as a default on a group in domain control.
-
@Nicole Trepanier okay, understood. If that's the case though, the more typical API approach would be to have business logic in the application (i.e. within Expensify) that validates things like that, while still making a Policy Delete function available for the situations when it would be useful and valid to use. So, calling Policy Delete on a policy that does not meet validation criteria could simply return an error to the API user e.g.
{ "responseMessage": "this policy is too cool to delete", "responseCode": 422 }
What about the ability to adjust the name of a Policy? That could either be part of the existing Policy Update or a new independent Policy Rename function. And (to continue the theme haha) what about removing Employees? All of these validations could be server-side and allow us (and by "us" I mean the integrated application I'm working on 😀) to do what we need to do.
-
@matthewpoer We do want to update the API capabilities in the future so I think this would make a great Idea post. Other Expensify users will be able to vote on the idea and we can gauge the demand for it.
The most popular ideas will be reviewed by our team and have a real chance of being placed on our roadmap.
Feel free to jump right into sharing your idea.
-
Thanks @Nicole Trepanier
I've registered three new Ideas there after following your link. To encourage future readers of this thread to vote accordingly, I'll link to them here as well: