When to use this endpoint

Obtain queue_id from Operations. It is the global queue-row ID, not the Job ID. This is not a provider receipt withdrawal or an undo for already accepted work.

Authentication and permissions

Authenticate with signed API-key fields or a logged-in CRM session; session dispatch applies CSRF checks. The authenticated tenant must have features2.ukDigitalWasteManagement=1. The feature is read from the account record, not trusted from request input.

Requires Jobs Edit through Core_requirePermission('edit', 'pageJobs').

Job reads and mutations enforce the authenticated tenant, active Job, TeamAccess department/assignment scope and the legacy department-based customer boundary. Collections filter before counts/pagination; explicit Job and cancellation requests check access before a service call or queue mutation.

Parameters

ParameterTypeRequiredDescription
queue_idInteger-compatibleYesNonzero queue-row ID. Lookup requires this tenant, type 102, deleted=0 and status=0 (pending); already running rows normally fail.

Example request

$result = FM_api('DigitalWasteTracking_queueCancel', [
	'queue_id'=>'2088',
]);

Example response

{
  "ok": 1
}

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":"UK Digital Waste Tracking is not enabled for this account"}The account feature is disabled.
{"error":"invalid queue ID"}The converted ID is zero.
{"error":"queued submission not found or already running"}No pending type-102 row matches this tenant and ID.
{"error":"permission denied"}The required page action is absent; the shared permission helper retains its legacy roleless fallback.
{"error":"job not found or outside your record scope"}The explicit Job or queue’s Job is missing, deleted or hidden by record scope. Bulk queueing reports this per Job.

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 lookup is tenant/type/pending-scoped, with no due_time restriction: both due and future pending work can be selected. Missing, deleted or already claimed rows return an error.
  • After lookup, writes deleted=1,status=2,hdate=current Unix seconds and logs cancellation against the queue’s obj_id Job. It does not change receipt mappings, Job answers, provider state or other pending work.
  • Cancellation is a conditional tenant/type/pending/nondeleted UPDATE. Exactly one affected row is required; if a worker claims first, cancellation fails and no success history is written. A cancelled row cannot be won twice.
  • The global queue change cannot be rolled back by a later tenant-history failure. That case returns ok=1,cancelled=1 and a warning; it does not invite queueing another provider submission.

Side effects

  • Conditionally marks the existing queue lifecycle deleted/finished and records checked Job history after winning. No provider cancellation or migration.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found in the production JavaScript source. The operator workflow is implemented in CRM2.

CRM2

Operations > queued row > Cancel submission sends DigitalWasteTracking_queueCancel with queue_id from the row and then reloads the table.

Related endpoints