Job types
Set a job type’s default notes
/a/JobType_setNotes
Replace the default notes that job editors copy when this type is selected.
When to use this endpoint
Use JobType_setNotes for CRM1’s Job Types notes dialog. CRM2 normally stores structured note-list text through JobType_updateData.
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
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Job-type ID. Presence is checked, then the value is integer-converted; zero reaches the not-found response. |
value | String | Yes | Complete replacement notes. Empty string is accepted. The handler does not validate plain-text versus encoded note-list format. |
Example request
$result = FM_api('JobType_setNotes', [
'id' => '42',
'value' => 'Check access restrictions before dispatch.',
]);
Example response
{
"ok": 1
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"no ID provided"} | The id key is absent or null. |
{"error":"no value provided"} | The value key is absent or null. |
{"error":"appointment does not exist"} | No job type matches the integer-converted ID. This exact legacy response has not yet adopted current job terminology. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- CRM1 copies the notes when the type changes. CRM2 also treats them as defaults in the job editor. Existing jobs are not updated later.
- An ordinary unchanged value returns success without a write.
- This focused route does not scan structured notes for
@mentions.
Side effects
- On detected change, updates notes and
last_editedand writes a legacy “meeting types / set notes” audit entry. - The query advances the jobs cache marker rather than the job-type cache marker, a legacy cache-key quirk.
See it in Fieldmotion
CRM1
Open Settings → Job Types, open a row’s Notes dialog, and save. CRM1 calls this route directly.
CRM2
CRM2’s Job Types notes editor uses the mapped update path rather than this focused setter.
Related endpoints
JobType_updateDatarecords mapped note history and can create in-CRM mention notices.JobType_getRequestedDetailsreads the raw notes value.