When to use this endpoint

Use EmailTemplate_getRequestedDetails when a caller needs a mapped field subset or several templates. Use EmailTemplate_get for one complete raw row.

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
fieldsNative arrayNoMapped fields to return from id, name, body, archived, fromEmail, isDefault, subject, type, meta, and metaFormID. Omission requests every mapped field; unknown names are ignored and id is always included.
id / idsInteger-compatible or native arrayNoOptional numeric ID filter. id takes precedence over ids; scalar values and array members are integer-converted.
name, body, fromEmail, subject, meta, metaFormIDScalar or native arrayNoExact case-insensitive mapped filters. Arrays become exact IN filters.
archived, isDefault, typeScalar or native arrayNoExact integer-converted filters.
orderNative arrayNoMapped order names or objects such as [['id' => 'name', 'dir' => 'desc']]. No order is applied when omitted.

Example request

$templates = FM_api('EmailTemplate_getRequestedDetails', [
	'fields' => ['id', 'name', 'subject', 'type', 'archived'],
	'archived' => '0',
	'order' => [['id' => 'name']],
]);

Example response

[{
  "id": "152004",
  "name": "Service completion email",
  "subject": "Your service report",
  "type": "1",
  "archived": "0"
}]

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.
[]No rows match, an ID array has no usable IDs, or filters exclude every row.

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

Behaviour and edge cases

  • This endpoint has no pagination, implicit limit, or implicit ordering. Omitting filters can return every template, including archived rows.
  • meta is returned as stored text. The nested metaFormID projection has a legacy alias-order quirk: request meta before metaFormID to obtain the nested value. If metaFormID is requested first or alone, the shared reader aliases the scalar extraction as meta and then returns metaFormID as null.
  • The requested fields value must be a native array by the time the handler runs; the shared signed-request dispatcher is responsible for decoding encoded arrays.

See it in Fieldmotion

CRM1

No direct CRM1 caller was found; CRM1 uses raw detail and dedicated list endpoints.

CRM2

Open a customer’s Emails page. CRM2 requests id and name for template labels while loading email history.

Related endpoints