When to use this endpoint

Use the record ID from DataSyncs_list. This handler does not stop an installed agent; cancellation and local installation cleanup are separate operations.

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; session requests require the dispatcher’s CSRF token where configured. Tenant rows and settings belong to that authenticated account.

These handlers add no accounting page or CRM2 role check. The dispatcher has no Accounting/DataSync object-scope mapping. Settings-screen access controls are separate from these shared API handlers; CRM2 screen roles are not a CRM1 API requirement.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesPositive DataSync record ID from DataSync_new or DataSyncs_list, not an instruction ID.

Example request

$result = FM_api('DataSync_delete', ['id'=>'14']);

Example response

{
  "ok": 1
}

Database numeric values can be strings. Read the JSON error/warning fields as well as the HTTP status.

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 parameter: id"}Missing, zero or negative ID.

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

Behaviour and edge cases

  • A nonexistent record returns ok:1 with warning:sync not found. Historical cloud records are accepted by this cleanup route.
  • Removes the datasyncs row and datasyncLastChecked<ID> setting. Existing instruction rows and api_syncs links are not removed, and no remote provider disconnection is attempted.
  • The two deletes are separate, unchecked queries. The response is an acknowledgement from this handler rather than a count or proof of complete cleanup.

Side effects

  • Deletes the saved connection/checkpoint; no agent uninstall, cancellation signal, mapping cleanup or business-object change is performed.

See it in Fieldmotion

CRM1

Open Settings → Data Sync. The pageSettingsDataSync screen uses this route for the operation described above; filter browser Network requests by the exact function name. Local-agent setup is separate from the cloud Finance integrations. Select a connection and confirm Delete; the request contains that record’s id.

CRM2

Open Settings → Data Sync. The CRM2 pageSettingsDataSync screen retains this local-agent workflow; filter browser Network requests by the exact function name. Its screen permissions do not add a role check to this shared handler. Select a connection and confirm Delete; the request contains that record’s id.

Related endpoints