When to use this endpoint

Use explicit rule IDs from the catalogue; every recognized mapped key can otherwise participate in deletion.

Authentication and permissions

Use signed API-key authentication or a logged-in CRM session on the account’s routed host. API keys act as their owner; normal session requests need dispatcher CSRF protection where configured. Tenant data is selected from the authenticated account.

The handler has no additional page-action/Role check. A CRM2 screen hiding a control does not add such a server guard, and CRM2 role names must not be assumed to apply to CRM1. The dispatcher has no dedicated object-scope mapping for this namespace.

Parameters

ParameterTypeRequiredDescription
Mapped filtersScalar or native listYesAt least one mapped filter is required. name, subject, body, recipient (JSON), replyTo, tableName, status, type, format, meta (JSON), cdate and lastEdited. name/replyTo/tableName have storage varchar(100) limits, without equivalent route-owned length checks. id is also in the low-level map. Filters combine with AND; text uses equality and lists use IN. ids is not a mapped selection alias; use id. Empty matches return ok.

Example request

$result = FM_api('NotificationType_deleteData', ['id'=>'18']);

Example response

{
  "ok": 1
}

Application errors normally remain JSON responses with HTTP 200; inspect error/warning keys. Numeric driver values can be strings.

Errors and unusual responses

ResponseCondition
{"error":"not logged in"}No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs.
{"error":"missing or invalid filter"}No recognized mapped filter.
{"error":"Could not read records for deletion. Please retry."}Selection query failed.
{"error":"Could not record deletion audit."}Deletion audit failed.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • The generic delete helper selects matching rows, deletes them and writes deletion audit/history. notification_types is not in its soft-delete table list; this currently removes configuration rows. No queue cancellation is called by the wrapper.
  • Existing scheduled mail/Push work is not demonstrated to disappear by deleting the template; inspect queue state separately. This route has no pagination or batch limit.
  • The singular wrapper wraps the generic deletion/audit in a tenant transaction and rolls back a returned error. A scalar id also supplies a before snapshot for normalized notification history after commit; multi-ID/mapped-filter selection does not produce one snapshot per deleted rule.

Side effects

  • Invalidates rule cache and records generic deletion audit. For a scalar before snapshot, adds the normalized notification delete event after commit. A later history failure cannot restore the committed rule.

See it in Fieldmotion

CRM1

Settings > Notifications Email/Push uses mapped notificationType requests; Push requires the UI pushNotifications feature. UI-required names/subjects are stronger than the generic server map.

CRM2

Settings > Notifications, Email/Push: create/edit, inline status, Copy and Delete use the shared notificationType module and these routes. Inspect the request’s tableName/type/format and encoded recipient/meta.

Related endpoints