Customer SFTP imports
Remove a customer SFTP source
/a/ImportCustomersFtp_delete
Remove an account-owned source without deleting its maps or imported customers.
When to use this endpoint
Use when retiring a source. This is separate from deleting imported business records through Import History.
Authentication and permissions
Use signed API-key authentication or a logged-in CRM session. API keys act as their owner; session requests use dispatcher CSRF protection when configured.
Requires a valid tenant account and View on pageImportsCustomersFtp plus Delete. Source IDs and counts are restricted to the authenticated account owner; client-supplied ownership cannot expand access.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Positive integer or decimal integer string | Yes | Use the source or tenant row ID returned by its list/table. Fractions, negative numbers, arrays and out-of-range integers are rejected. This is not the import run token. |
Example request
$result = FM_api('ImportCustomersFtp_delete', ['id'=>'18']);
Example response
{
"ok": 1
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error": "permission denied"} | The user lacks the required Imports page action. |
{"error": "missing or invalid parameter: id"} | A required row ID is missing or invalid. |
{"error": "no such entry"} | The requested owned source or tenant row does not exist. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Deletes only the account-owned global source configuration under the same owner lock used by import runs. Maps, customers, tenant history and remote files remain. Existing configuration-row removal behavior is retained.
- Reconciles features_used bit 8 based on remaining enabled sources, preserving unrelated bits. Missing sources return an error rather than idempotent ok.
- Checked database writes roll back within their database transaction. Global source settings and tenant audit writes are separate commits: saved=1 with a warning means the setting was saved but a follow-up failed. Inspect the saved state; do not blindly repeat a write.
Side effects
- Checked configuration removal and usage reconciliation, source-cache invalidation and redacted tenant audit. No customer or remote-file deletion.
See it in Fieldmotion
CRM1
In CRM1, open Settings > Imports > Customers FTP. Click the source Delete action and confirm; inspect ImportCustomersFtp_delete.
CRM2
In CRM2, open Imports > Customers FTP. Use Delete on the source or bulk selection; the UI calls this scalar endpoint per ID.
Related endpoints
ImportCustomersFtp_save— Configure an owned source.ImportsCustomersFtp_getDataTable— Discover source rows and IDs.ImportCustomersFtp_getImportMaps— Inspect map choices before running.ImportCustomersFtp_runOnce— Understand import writes and remote cleanup.