When to use this endpoint

Use Asset_archive to remove one live asset from normal asset lists while retaining it for the archived view and later restoration.

Use Asset_delete only for the separate soft-delete action performed from the archived view or import-history cleanup.

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 server-side asset ID. The handler does not verify that the row exists.

Example request

$result = FM_api('Asset_archive', [
	'id' => '4821',
]);

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"}id is absent or does not convert to a positive integer. This validation precedes login enforcement.

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 endpoint sets archived=1 and updates last_edited. It does not set deleted, ddate, or edited_uuid.
  • Repeating the call is not treated as a no-op; it refreshes last_edited and produces another deletion marker and audit entry.
  • The asset update does not explicitly invalidate the asset cache because the legacy cache argument is passed outside the query options.
  • This is a single-record mutation with no filtering or pagination.

Side effects

  • Inserts an assets row in the tenant deletion log so app/offline clients can remove the asset from active data.
  • Writes an asset audit-log entry. The update, deletion marker, and audit entry are not transactional.

See it in Fieldmotion

CRM1

Open Assets or a customer’s Assets tab, choose Archive on a live row, confirm the dialog, and filter Network requests for Asset_archive.

CRM2

No direct production CRM2 call to Asset_archive was found; CRM2 uses its module-level asset actions rather than this CRM1 route.

Related endpoints

  • Asset_unarchive returns an archived row to live lists and removes its deletion markers.
  • Asset_delete performs a soft deletion rather than an archive.
  • Asset_get can still retrieve archived, non-deleted assets.