DELETE function endpoint rejects type=on-event instead of returning function_managed_by_deploy
Current behavior
The function-deletion endpoints (DELETE /integrations/:uniqueKey/functions/:name and its v1
equivalent) accept a type querystring param to disambiguate functions that share a name across
sync/action/on-event. The param's validation schema only allows sync and action — passing
type=on-event is rejected with a generic invalid_query_params (400) error.
This is misleading: the deletion handler (handleDeleteIntegrationFunction) already has logic
that specifically detects on-event functions and returns function_managed_by_deploy for them
(since on-event functions are always deploy-managed, never standalone). That logic is just
unreachable today because the request never gets past querystring validation.
Expected behavior
type=on-event should be accepted by validation and fall through to the existing
function_managed_by_deploy handling, so callers get an accurate, specific error instead of a
generic "invalid type" rejection.
Why this matters
Right now a client trying to delete an on-event function (or a tool built against the API) has no way to distinguish "you typo'd the type param" from "this function type can't be deleted this way" — both return the same generic error.
Happy to open a PR for this — it's a small, contained fix (validation schema + type widening in a couple of controller/type files), no behavior change to any function that isn't on-event.
Source: NangoHQ/nango