Skills
Create a skill through the field map
/a/Skill_createData
Create a skill through CRM2’s generic field map and record the accepted fields in generic history.
When to use this endpoint
Use Skill_createData for the CRM2 Skills screen’s shared create workflow. Use Skill_new when administrator enforcement, trimmed input, and duplicate-name detection are required.
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 |
|---|---|---|---|
name | String | No | Stored name. When supplied it is limited to 100 Unicode characters; blank and duplicate names are accepted. |
description | String | No | Stored description with no endpoint length limit; blank is accepted. |
cdate | Datetime string | No | Mapped as a datetime: blank becomes SQL null, but nonblank text is not date-validated. The tenant column is actually an integer timestamp, so integrations should omit this field and let the database default apply. |
lastEdited | Integer string | No | Integer-converted last_edited. Omission does not generate current time because this legacy map declares the field as int; the database default is used. |
id | Any | No | Ignored during creation even though it is present in the shared map. |
Example request
$created = FM_api('Skill_createData', [
'name' => 'Electrical testing',
'description' => 'Qualified to complete electrical tests',
]);
Example response
{
"ok": 1,
"id": 42
}
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":"missing or invalid parameters."} | No writable mapped field or default is present. |
{"error":"name is too long."} | name exceeds 100 Unicode characters. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- At least one of
name,description,cdate, orlastEditedmust be supplied. Unknown keys are ignored. - No filtering or pagination applies; exactly one row is attempted.
- The shared map/schema mismatch means a nonblank
cdatestring is handed to an integer database column. The endpoint does not normalize it to Unix time.
Side effects
- Inserts one tenant skill, advances the
skillscache marker, and writes generic field-level audit entries for accepted fields. - No user is assigned the new skill and no existing job or form constraint is changed.
See it in Fieldmotion
CRM1
A production-source search found no direct CRM1 caller. CRM1 creates skills through Skill_new.
CRM2
Open Users → Skills and create a row. The shared display widget derives Skill_createData from the singular API prefix and exposes the action according to the page’s client-side permissions.
Related endpoints
Skill_newis the administrator-only, duplicate-aware create route.Skill_updateDatachanges the same mapped fields.