Jobs: reports, email and links
Unlink a task from a job
/a/Job_taskUnlink
Remove a task-to-job relation and record the removed link for synchronization.
When to use this endpoint
Use the unlink control in the task/job linked-items list. This does not delete the task or job.
Authentication and permissions
Signed API-key authentication or a logged-in CRM session is required. The handler uses the authenticated tenant and has no additional role/page check.
The dispatcher also applies user/account and IP restrictions. CRM sessions carrying a CSRF token must supply X-FMCSRF or _csrf; missing or incorrect tokens can be rejected before the handler runs.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
job_id | Integer string | Yes | Positive physical job ID; missing/deleted objects do not prevent removing a retained link. |
task_id | Integer string | Yes | Positive task ID; missing/deleted objects do not prevent removing a retained link. |
Example request
$result = FM_api('Job_taskUnlink', [
'job_id' => '1042',
'task_id' => '703',
]);
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":"missing or invalid parameter: job_id"} | Missing/nonpositive job ID; task_id has analogous guard. |
{"error":"Unable to save job delivery changes"} | A checked database write, audit or transaction failed; local transactional writes roll back. Cross-tenant files/commits are not distributed-atomic. |
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 all type-8 relations for the exact from_id/to_id pair in the authenticated tenant. A missing pair still returns ok.
- Locks all matching link IDs and records every removed ID through Core_logDeletion, including duplicate legacy pairs. Link removal and audits commit together.
- Active object state/status/assignment is not required to remove a retained relation. The job/task rows are locked when present; removal and every audit are checked and transactional. No paging applies.
Side effects
- Physically removes association rows, not the business objects. Records a tenant manymany deletion when a link ID was found so mobile sync can remove it.
- No explicit job/task history, object edit timestamp, cached-field recalculation or mail is performed.
See it in Fieldmotion
CRM1
Unlink from a job’s linked task or Tasks/task edit linked-job list. pageJob/pageTasks/pageTaskEdit call Job_taskUnlink with the pair.
CRM2
Use unlink in the task/job linking widgets or Tasks module; widgetJobToTaskLink/widgetTaskToJobLink and moduleTasks call Job_taskUnlink.
Related endpoints
Job_taskLinkcreates the association.Job_unlinkhandles quote/invoice associations instead.