When to use this endpoint

Use JobType_setNotification for CRM1’s Notifications selector. The stored override is consulted when a job is assigned/reassigned and when attendee email is requested.

Authentication and permissions

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

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesExisting positive job-type ID.
valInteger stringYesNonnegative override after integer conversion: 0 uses the form/general rule, 1 disables, and 2 enables. Other nonnegative integers are accepted; consumer logic treats values of at least 2 as enabled.

Example request

$result = FM_api('JobType_setNotification', [
	'id' => '42',
	'val' => '2',
]);

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"}The ID integer-converts below one.
{"error":"missing or invalid parameter: val"}The value is absent or integer-converts below zero.
{"error":"job type does not exist"}No type matches the ID.

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

Behaviour and edge cases

  • General tenant setting disable-job-notification supplies the initial rule. A nonzero form override replaces it, then a nonzero job-type override replaces the form rule.
  • Changing this metadata does not itself send email and does not retroactively affect messages already sent or queued.
  • Invalid or non-object metadata is replaced with an object; otherwise unrelated keys are preserved.

Side effects

  • On change, writes meta.send_notification, updates last_edited, and advances the job-type cache marker.
  • This focused setter writes no generic field-level audit entry.

See it in Fieldmotion

CRM1

Open Settings → Job Types and change Notifications between blank, no, and yes. CRM1 calls this endpoint directly.

CRM2

CRM2 displays the same three choices but normally saves mapped field metaSendNotification through JobType_updateData.

Related endpoints