Tasks
List lightweight task records
/a/Tasks_list
List active task IDs and a small optional field set, optionally restricted to a customer or edit window.
When to use this endpoint
Use Tasks_list for lightweight task selection when the full table APIs are unnecessary. CRM job-link dialogs use it to find tasks for one customer.
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 rows come from the authenticated tenant. Unless the page says otherwise, IDs, creator, assignee, and privacy do not restrict the result at handler level.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
customer_id | Integer-compatible | No | Restricts tasks to this stored customer ID. Missing and invalid values are not distinguished; invalid text becomes 0. |
last_edited | Datetime string | No | Exclusive lower bound. Results must also be earlier than the server’s current Y-m-d H:i:s value captured for this request. The format is not validated. |
fields | Native array or JSON array | No | Additional allowed fields: id, last_edited, subject, due_date, and details. id is always selected; unknown fields are ignored. |
Example request
$tasks = FM_api('Tasks_list', [
'customer_id' => '1042',
'fields' => json_encode(['subject', 'due_date']),
]);
Example response
[
{
"id": 318,
"subject": "Confirm access details",
"due_date": "2026-10-02 09:30:00"
}
]
id is explicitly converted to a JSON integer; optional database fields normally remain strings.
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. |
[] | No active task matches the filters. Invalid requested field names are silently ignored. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Soft-deleted tasks are excluded. There is no privacy, creator, assignee, task-status, or task-type filter.
- The endpoint has no pagination, limit, or ordering. Do not rely on row order.
- The edit window is
last_edited > supplied valueandlast_edited < current server time; both boundaries are exclusive.
See it in Fieldmotion
CRM1
From a Job, choose the action to link an existing task. CRM1 calls Tasks_list with that customer and displays ID, subject, and due date.
CRM2
The Job-to-Task link widget makes the same customer-scoped call and also requests details for its picker. Its locally prepared permission filter is not sent to this endpoint.
Related endpoints
Tasks_listByLastEditedreturns only IDs changed at or after a checkpoint.Tasks_getByIdfetches selected raw columns once IDs are known.