Skip to content
AISARAISAR
Custom fields

Custom fields

Custom field deleted

custom_field.deleted

Fires when a field is deleted for good together with all its values. Only an archived field can be deleted; `DELETE /v1/custom-fields/{customField}` answers `202` and queues the deletion, and the event comes later, once the field row is really gone. If the field is restored before that, the deletion is cancelled and no event is sent. The payload carries the last state of the field, so `archived_at` is filled. The field catalog is shared by the whole company, so the integration channel filter (`channelFilter`) does not apply to these events: they reach an integration pinned to specific channels too.

HTTP request

AISAR sends a signed POST request to your webhook_url:

http
POST {webhook_url}
Content-Type: application/json
X-AISAR-Signature: sha256=...

{
  "event": "custom_field.deleted",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-15T07:00:00.000000Z",
  "company_id": 1,
  "data": {
    "custom_field": {
      "id": 12,
      "entity_type": "contact",
      "key": "istochnik",
      "label": "Источник",
      "description": null,
      "type": "select",
      "options": [
        { "key": "sait", "label": "Сайт", "position": 0, "archived": false },
        { "key": "reklama", "label": "Реклама", "position": 1, "archived": false }
      ],
      "settings": {},
      "is_ai_readable": false,
      "position": 1,
      "archived_at": "2026-11-14T08:00:00.000000Z",
      "created_at": "2026-11-12T09:30:00.000000Z",
      "updated_at": "2026-11-14T08:00:00.000000Z"
    }
  }
}

The X-AISAR-Signature header carries an HMAC-SHA256 signature of the request body — use it to verify the request came from AISAR.

Example payload

json
{
  "event": "custom_field.deleted",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-15T07:00:00.000000Z",
  "company_id": 1,
  "data": {
    "custom_field": {
      "id": 12,
      "entity_type": "contact",
      "key": "istochnik",
      "label": "Источник",
      "description": null,
      "type": "select",
      "options": [
        { "key": "sait", "label": "Сайт", "position": 0, "archived": false },
        { "key": "reklama", "label": "Реклама", "position": 1, "archived": false }
      ],
      "settings": {},
      "is_ai_readable": false,
      "position": 1,
      "archived_at": "2026-11-14T08:00:00.000000Z",
      "created_at": "2026-11-12T09:30:00.000000Z",
      "updated_at": "2026-11-14T08:00:00.000000Z"
    }
  }
}

Payload fields

FieldTypeDescription
custom_field.idintegerField ID
custom_field.entity_typestringWhat the field belongs to: `contact`, `conversation` or `organization`
custom_field.keystringThe machine name of the field. The value sits under this key in the contact, conversation or organization `custom_fields` and in `changes` names of the form `custom_fields.<key>`
custom_field.labelstringThe field label on the card
custom_field.descriptionstring|nullThe field hint
custom_field.typestringThe field type: `string`, `textarea`, `number`, `date`, `select`, `multiselect`, `checkbox`, `url`, `phone`, `email`
custom_field.optionsarray|nullChoice options `[{key, label, position, archived}]` of `select` and `multiselect` fields; `null` for other types
custom_field.settingsobjectDisplay settings, for example `decimals` of a number field; always an object, may be empty
custom_field.is_ai_readablebooleanWhether AI employees can read the field value
custom_field.positionintegerThe field place in the list. Reordering (`PUT /v1/custom-fields/order`) sends no event
custom_field.archived_atstring|nullWhen the field was archived (ISO 8601); `null` for an active field
custom_field.created_atstringCreation time (ISO 8601)
custom_field.updated_atstringLast change time (ISO 8601)