Tasks
Move a task by minute offset
/a/Task_move
Shift a New or Open task’s due datetime by a signed number of minutes for calendar drag-and-drop.
When to use this endpoint
Use Task_move for the CRM1 calendar’s relative drag operation. CRM2’s current calendar writes an absolute mapped datetime through Task_updateData.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional task, page, role, ownership, or privacy-permission check.
All reads and writes use the authenticated tenant. CRM1 and CRM2 apply task visibility and editing permissions in their interfaces, but these handlers do not repeat those client-side rules.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer-compatible | Yes | Task ID. Only rows with numeric status below 2 are eligible. |
minutes | Integer-compatible | Effectively | Signed minute offset. Missing or nonnumeric values become 0. |
Example request
$moved = FM_api('Task_move', [
'id' => '318',
'minutes' => '90',
]);
Example response
{
"ok": 1,
"new_task_time": "2026-10-02 11:00:00",
"hours": "0"
}
hours is the task’s unchanged time_spent database value; the endpoint does not convert its unit.
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":"no ID provided"} | ID is absent or integer-coerces to zero. |
{"error":"no such task"} | No row with that ID has status below 2. Closed (2) and Archived (3) tasks are deliberately indistinguishable from missing rows. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Uses PHP datetime parsing on the stored due date plus the signed minute string. Positive and negative offsets are accepted.
- The lookup does not include a
deleted=0filter, so a deleted New/Open row can still have its due date changed. - This write does not refresh
last_edited, validate the resulting datetime, or use the unuseddaysvalue sent by CRM1.
Side effects
- Updates only
due_dateand invalidates the task cache. It writes no audit entry or notification.
See it in Fieldmotion
CRM1
Drag a New/Open item in Tasks → Calendar. CRM1 computes the minute delta and calls Task_move (it also sends an ignored days value).
CRM2
CRM2 calendar drag-and-drop calls the generic mapped updater with an absolute task datetime, not Task_move.
Related endpoints
Task_setDueDatereplaces the due datetime with an absolute value.Task_updateDatais CRM2’s mapped calendar write.