When to use this endpoint

Use the underlying record ID; this namespace does not imply a customer filter. Supply customer to select a customer’s Tasks.

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 where configured. IDs and mapped queries address the authenticated tenant.

Login is required. CRM2 requests require Tasks View (pageTasksMain, with legacy pageTasks fallback) and Edit for changes. CRM2 TeamAccess scope applies to records and related data. These added CRM2 role/scope checks do not apply to CRM1 requests; CRM1 retains its legacy permission model. Tenant isolation and business validation apply to both clients.

For CRM2 non-admins, an explicit pageTasksMain_viewCreatedAndAssignedOnlyByUser restriction limits results to Tasks they created or are assigned. Otherwise absence of pageTasksMain_viewPrivateTasks restricts reads/writes to public Tasks. Creating a private Task or changing public to private requires pageTasksMain_setTaskPrivate. These privacy-role additions do not apply to CRM1.

Parameters

ParameterTypeRequiredDescription
id / idsPositive integer or native/JSON-encoded listYes for updates; optional for readsid takes precedence. Decimal integer strings are accepted and duplicates removed; invalid/nonpositive members reject the selection. Empty lists select no records. Omitted IDs on a read leave the other mapped filters in control.
customer / user / typeNonnegative integer IDscustomer required on createcustomer is the associated Customer, user the assignee, type the Task type. Positive references must exist in this tenant; Customers must be active and CRM2-visible, users active. Zero means no linked customer/unassigned/no type. user defaults 0.
subject / details / resolutionTextNoSubject is at most 128 Unicode characters on every write. On create, missing/blank subject derives up to 128 characters from details, replacing newlines with spaces. details defaults empty; details/resolution are limited to 65,535 characters.
status / privacyInteger enumNostatus: 0 New, 1 Open, 2 Closed, 3 Archived. privacy: 0 Private, 1 Public. Omitted CRM2 create privacy becomes public if setTaskPrivate is absent; CRM1 retains its storage default.
assignedDate / dueDate / minutes / metaDatetime / nonnegative number / encoded textNoDatetime input must be an exact real YYYY-MM-DD HH:MM:SS; blank edits clear to NULL. On create, absent/null/blank dueDate or NaN-NaN-NaN NaN:NaN:NaN becomes server now. assignedDate defaults now. minutes is a finite nonnegative value. meta is whole text/encoded JSON, not merged; canonical custom-value fields are not mapped here.

Example request

$result = FM_api('CustomerTask_updateData', ['id'=>'18','subject'=>'Confirm the service visit','status'=>'1']);

Example response

{
  "ok": 1
}

Scalar numeric values may be strings or numbers depending on the database driver.

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": "Your role does not permit this action."}A CRM2 request lacks the required View/action grant.
{"error": "Record is unavailable or outside your permitted scope."}A selected write target is unavailable or outside CRM2 scope.
{"error": "missing or invalid parameter: id/ids"}An update omits its selection, or supplies an invalid/nonpositive ID.
{"error": "Unable to complete this operation. Check the saved state before retrying."}An unexpected persistence failure is reported; inspect saved state before retrying.
{"error": "Subject too long. 128 characters max"}The supplied subject exceeds 128 Unicode characters.
{"error": "Unavailable user"}A positive assignee does not resolve to an active tenant user.

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

Behaviour and edge cases

  • Record identity and lifecycle values are server-owned. Inline writes reject id and lifecycle targets. Full edits tolerate unchanged lifecycle values from a fetched record and reject changed ones; create derives them on the server. Transport metadata such as CSRF/API/session keys and extra is not a business-field update.
  • Omitted or native-null optional mapped values are skipped on edits. Blank text is saved; blank date/datetime/JSON clears to SQL NULL where mapped. Date fields require real YYYY-MM-DD. Ordinary numeric fields retain the mapped numeric conversion; the explicit ID/reference/enum checks listed here run first.
  • Selected records are checked before writes. Tenant primary writes run in one checked transaction: a later validation/write failure rolls back earlier members of the batch. Empty/no-change updates return ok=1 and warning="No Change."; inline responses also carry oldData with previous storage-column values. Unknown business fields are ignored by the mapped writer.
  • Writes mapped Task state without invoking the canonical Task workflow/event APIs. Reassigning an existing Task does not send a new assignment message in these aliases.
  • No direct caller of this exact namespace was found in the current mobile intermediary/app sources; mobile synchronization uses separate APIs.

Side effects

  • Changed mapped values stamp last_edited, invalidate the affected table cache and record field-change history. Read the saved object back before performing dependent work.

See it in Fieldmotion

CRM1

In CRM1, open Customers > a record > Tasks. The current screen calls Customer_getEventsDT and links to the canonical Task editor; no direct current call to this CustomerTask alias was found.

CRM2

In CRM2, open Customers > a record > Tasks. pageCustomerTasks passes its customer filter to shared moduleTasks, which selects Task/Tasks API prefixes. No direct current call to this legacy CustomerTask alias was found; inspect canonical Task/Tasks requests for the current UI workflow.

Related endpoints