When to use this endpoint

Use EmailTemplate_updateData only for controlled mapped-field updates. Use EmailTemplate_save for editor submissions because it validates names and senders, sanitizes HTML, processes images, and manages the default template.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler requires login and performs no additional page or role-permission check.

The read or write is limited to the authenticated tenant. Notice endpoints that say “current user” use the authenticated session user ID within that tenant.

Parameters

ParameterTypeRequiredDescription
idInteger-compatible or native arrayYesTarget ID or IDs. Scalar and array values are integer-converted; an ID array applies the same supplied values to each row.
name, body, archived, fromEmail, isDefault, subject, type, meta, metaFormIDMapped valueNoAny subset of id, name, body, archived, fromEmail, isDefault, subject, type, meta, and metaFormID. No field is required by this map, and the full-save validation rules are not run.

Example request

$result = FM_api('EmailTemplate_updateData', [
	'id' => '152004',
	'subject' => 'Your updated service report',
	'metaFormID' => '81',
]);

Example response

{"ok":1}

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: id"}id is absent.
{"warning":"no updated fields."}No recognized mapped field remains after removing the ID.
{"warning":"No data."}No template matches the scalar numeric ID.
{"warning":"No Change."}All supplied mapped values compare equal to stored values.

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

Behaviour and edge cases

  • Only recognized supplied fields change. metaFormID updates the nested metadata key while preserving other keys; supplying raw meta can replace them.
  • A native ID array discards per-row errors and warnings and returns {"ok":1} after attempting every ID.
  • The map contains no timestamp, so this route does not add or update a last-edited value.

Side effects

  • Changed rows invalidate the email-template cache and generate Core history per changed mapped field.

See it in Fieldmotion

CRM1

No direct CRM1 production caller was found.

CRM2

No direct CRM2 production caller was found; normal template edits use EmailTemplate_save.

Related endpoints