When to use this endpoint

Use Tasks_getById when IDs are already known and a caller needs a narrow set of raw task columns. Use Task_getRequestedDetails for mapped field names and linked-job information.

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

ParameterTypeRequiredDescription
idsNative array or JSON arrayYesTask IDs. Values are integer-coerced and deduplicated. Supply a nonempty array; a scalar string is not a supported shorthand.
fieldsNative array or JSON arrayNoSelected raw columns. Defaults to every allowed field: appId, assigned_date, assigned_to, cdate, client_id, created_by, details, due_date, edited_uuid, id, last_edited, meta, privacy, resolution, status, subject, time_spent, and type. Unknown and duplicate names are ignored.

Example request

$tasks = FM_api('Tasks_getById', [
	'ids' => json_encode(['318', '319']),
	'fields' => json_encode(['id', 'subject', 'status', 'last_edited']),
]);

Example response

[
  {
    "id": "318",
    "subject": "Confirm access details",
    "status": "1",
    "last_edited": "2026-09-28 10:42:16"
  }
]

Rows that are missing, soft-deleted, or outside the tenant are omitted. Database-backed values remain JSON strings.

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":"missing or invalid parameter: ids"}ids is absent.
{"error":"no fields selected"}fields is supplied but does not contain an allowed name.
[]No active task matches the normalized IDs.

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

Behaviour and edge cases

  • The query has no pagination and no ORDER BY; do not assume request order or database order.
  • Privacy, creator, and assignee are not checked. Soft-deleted tasks are excluded.
  • A malformed scalar or empty ID collection is not cleanly validated and can lead to warnings or a database-query error; send a nonempty array.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found; CRM1 batches editor lookups through Tasks_getDetails.

CRM2

The shared CRM2 Task object uses Tasks_getById to batch raw task lookups by ID.

Related endpoints