When to use this endpoint

Use Skill_setName when reproducing CRM1’s Skills name edit. It trims and byte-limits the name but does not enforce uniqueness.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session, and the identity must pass Core_isClientAdmin().

ID, blank-name, and length validation occurs before authentication. The update is scoped to the authenticated tenant.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesSkill ID after integer conversion; it must be greater than zero.
nameStringYesTrimmed complete replacement. Empty string and "0" are rejected. Maximum 100 bytes, not 100 Unicode characters.

Example request

$result = FM_api('Skill_setName', [
	'id' => '42',
	'name' => 'Electrical testing',
]);

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 is absent or below 1 after conversion.
{"error":"missing or invalid parameter: name"}The trimmed name is PHP-empty.
{"error":"parameter too long: name"}The trimmed name exceeds 100 bytes.
{"error":"not an admin"}The authenticated caller is not a client administrator.
{"ok":1}The positive ID does not exist; affected-row count is not checked.

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

Behaviour and edge cases

  • The name is trimmed before storage. The database schema also limits the column to 100 characters, while this endpoint rejects by byte length first.
  • No current row is loaded and there is no not-found response.

Side effects

  • Updates the name and sets last_edited to current Unix time.
  • Does not explicitly invalidate the skills cache or write generic audit history. Stored job/form constraints use IDs and are not rewritten.

See it in Fieldmotion

CRM1

Open Users → Skills, click a Name cell, change it, and leave the field. CRM1 sends Skill_setName.

CRM2

CRM2 edits names through Skill_updateData; the shared widget applies its page permission in the client, not in that handler.

Related endpoints