When to use this endpoint

Use Tasks_getCalendar only when reproducing the legacy Tasks Calendar contract. CRM2 uses the mapped task table and detail endpoints instead.

Authentication and permissions

The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler uses the tenant database prefix without calling the normal login guard.

It performs no task, page, role, ownership, or privacy-permission check. Any visibility restriction described below comes from request filters or a specific server-side rule, not from a general Tasks permission check.

Parameters

ParameterTypeRequiredDescription
startDate string or Unix timestamp secondsYesInclusive due-date lower bound. An integer value above 9999 is converted to Y-m-d in the server timezone; other values are compared as supplied.
endDate string or Unix timestamp secondsYes in practiceExclusive due-date upper bound. It is read without an explicit presence check. A timestamp above 9999 has 86,400 seconds added before conversion to a server-timezone date.
user_idsNative arrayNoAssigned-user IDs. A nonempty array becomes an integer IN filter; a scalar is ignored. ID 0 selects unassigned tasks.
type_idsNative arrayNoTask-type IDs. A nonempty array becomes an integer IN filter; a scalar is ignored.
statusesNative arrayNoTask statuses: 0 New, 1 Open, 2 Closed, 3 Archived. A scalar is ignored.
overdueTruthy valueNoAdditionally requires a due date earlier than the current server time and status below 2.
searchStringNoTrimmed case-insensitive substring across task ID, subject, details, resolution, assigned/due timestamps, active customer contact/address columns, and assigned-user names.

Example request

$events = FM_api('Tasks_getCalendar', [
	'start' => '2026-09-28',
	'end' => '2026-10-05',
	'user_ids' => ['17'],
	'statuses' => ['0', '1'],
]);

Example response

[
  [
    "318",
    "2026-09-27 14:05:00",
    "17",
    "2026-09-27 14:05:00",
    "1042",
    "Confirm the site access details.",
    "2026-10-02 09:30:00",
    "1",
    "",
    "1",
    "Confirm access details",
    "0",
    "3",
    ["1 High Street", "", "Dublin", "Dublin", "D02 AB12", "01 555 0100", "087 555 0100"],
    "2026-10-02 09:30:00"
  ]
]

Positions are: 0 ID, 1 assigned date, 2 assignee, 3 created date, 4 customer ID, 5 details, 6 due date, 7 privacy, 8 resolution, 9 status, 10 subject, 11 time spent, 12 type, 13 seven customer contact/address values, and 14 the due date repeated as an end-time seed.

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: start"}start is absent.
[]No visible active task is due inside the effective window. A missing end can also collapse the comparison after a PHP notice.

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 due-date window is due_date >= start and due_date < end. Timestamp-form end deliberately adds one fixed 24-hour period before date conversion; this is not daylight-saving-aware.
  • Soft-deleted tasks are excluded. Deleted customers are excluded from the join, but their tasks can still appear with blank customer contact/address values.
  • The tenant’s parent user sees all matching tasks. Another user with CRM access bit 1024 also bypasses privacy filtering; otherwise a task must be assigned to, created by, or public for the viewer.
  • There is no pagination or ordering. The dormant department_ids block is commented out and has no effect.

See it in Fieldmotion

CRM1

Open Tasks → Tasks Calendar, change its user/type/status/overdue filters, or search. The calendar requests Tasks_getCalendar for its visible date range.

CRM2

No direct CRM2 caller was found. CRM2 task calendar and Kanban screens use mapped task queries.

Related endpoints