When to use this endpoint

Contract_removeAppointment is the legacy wire alias for Contract_removeJob. New callers should use the canonical route.

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 stringYesPositive contract ID used for audit/cache attribution. The handler does not prove that the removed link belongs to this contract.
aidInteger stringYesPositive job ID whose type-6 legacy link is removed.

Example request

$result = FM_api('Contract_removeAppointment', [
	'id' => '720',
	'aid' => '2039001',
]);

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 contract ID is absent or nonpositive.
{"error":"missing or invalid parameter: aid"}The job ID is absent or nonpositive.

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 delete is keyed only by job ID and type 6; id does not scope it.
  • The job row’s direct contract_id is not changed, and missing rows still return success.

Side effects

  • Removes all matching legacy links, writes an audit entry against the supplied contract, and marks that supplied contract’s customer cache dirty.

See it in Fieldmotion

CRM1

No direct production CRM1 caller to this alias was found. Job save/delete flows use Contract_removeJob internally.

CRM2

No direct production CRM2 caller to this alias was found.

Related endpoints