Jobs: scheduling and lifecycle
Move a job start or due date
/a/Job_moveDatetime
Set an absolute start timestamp or convert it into a tenant-local due date.
When to use this endpoint
Use the CRM2 calendar/timeline move callback. referenceDate chooses the field; it is a selector, not a date string.
Authentication and permissions
Authenticate with signed API-key fields or a logged-in CRM session. Legacy edit-restriction bit 128 is enforced; client administrators retain the existing admin exception.
The primary job selection is tenant-scoped. There is no automatic schedule-conflict or assignee-ownership check. Cross-tenant follow-ups use persisted outsourcing context.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Positive active job ID. |
referenceDate | String | Yes | Exact meetingTime or dueDate. Omitted/null or unsupported values return missing or invalid parameter: referenceDate. |
timestamp | Integer string | Yes | Positive Unix seconds; milliseconds are not supported. Integer coercion occurs before selection. meetingTime inherits the narrow time setter's range checks; dueDate formats the epoch to a calendar date. |
Example request
$result = FM_api('Job_moveDatetime', [
'id' => '1042',
'referenceDate' => 'meetingTime',
'timestamp' => '1791885600',
]);
Example response
{"ok":1,"meeting_time_e":1791885600}
meetingTime returns Job_setMeetingTime unchanged. Changed dueDate returns {"ok":1}; unchanged date returns {"warning":"No Change."}.
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":"missing or invalid parameter: referenceDate"} | Selector omitted/null or not one of the supported exact values. |
{"error":"missing or invalid parameter: timestamp"} | Timestamp omitted/nonpositive after integer coercion. |
{"error":"no such job"} | Missing/deleted job. |
{"error":"Unable to update record"} | Mapped due-date persistence failed. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Both selector branches enforce the edit restriction with the client-admin exception. Unsupported selectors now return an invalid-referenceDate error instead of null.
- dueDate formats seconds with tenant timezone (missing Europe/Dublin, blank UTC), discards time and writes mapped due_date, not due_date_e.
- dueDate calls DataProcessClass directly, not Job_setDueDate/Job_updateData, so those reminder/outsourcing effects are not inherited. meetingTime uses the full narrow setter and returns its response.
- No conflict detection or batch pagination. Timeline assignment remains a separate client request.
Side effects
- meetingTime runs all narrow time-setter follow-ups. dueDate advances last_edited/edited_uuid=Job_moveDatetime and records mapped field history only when changed.
See it in Fieldmotion
CRM1
No direct caller was found in CRM1. Its timelines use Job_setMeetingTime and the calendar uses Job_move.
CRM2
Drag a job in Jobs Timeline, Assets Timeline or Jobs Calendar. The caller sends referenceDate and browser-computed seconds; timeline movement may then make a separate Job_setUserIdAndType request.
Related endpoints
Job_setMeetingTimeruns dependent scheduling updates.Job_moveshifts one start by elapsed minutes.Job_setUserIdAndTypehandles typed outsourcing handover.