When to use this endpoint

Use TaskType_createData for CRM2’s configurable Task Type Create layout. Use TaskType_new when a required nonblank name and compact legacy response are preferable.

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 Settings-page, role, create, edit, or delete permission check.

All reads and writes use the authenticated tenant. CRM1 and CRM2 decide whether to show task-type controls, but these handlers do not repeat those client-side checks.

Parameters

ParameterTypeRequiredDescription
nameStringNoStored name. The map does not mark it required, so omitted or blank input is accepted and can create an unnamed row.
cDateDatetime stringNoStored creation timestamp. Defaults to the current server datetime when omitted. Blank is accepted by the datetime converter.
lastEditedDatetime stringNoStored edit timestamp. Defaults to current server time when omitted; an explicitly supplied value is preserved on creation.
noRecordNative arrayNoShared helper audit-hiding control. Its create-path implementation checks the wrong loop key and is unreliable for individual task-type fields; do not depend on it.

Example request

$type = FM_api('TaskType_createData', [
	'name' => 'Customer follow-up',
]);

Example response

{
  "ok": 1,
  "id": 3
}

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 parameters."}No mapped value or default produces a field assignment. The wrapper normally supplies cDate, so this path is not expected for an ordinary request.

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

Behaviour and edge cases

  • Mapped fields are id (integer), name (text), cDate (stored as cdate), and lastEdited (stored as last_edited). id cannot be supplied on creation; unknown keys are ignored.
  • There is no duplicate-name, related-task, or maximum-length validation.

Side effects

  • Inserts a permanent task-type row, invalidates the task-type cache, and writes an audit-history entry for each mapped value/default processed by the shared helper.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found; CRM1 uses TaskType_new.

CRM2

Open Settings → Task Types. CRM2’s shared data widget derives the mapped create, detail, update, single-field update, and table routes from the TaskType/TaskTypes prefixes.

Related endpoints