Skip to content
AISARAISAR
Organizations

Organizations

Organization updated

organization.updated

Fires when the fields of an organization change (`PATCH /v1/organizations/{organization}`) or its custom fields change (`PUT /v1/organizations/{organization}/custom-fields`). Adding, editing or deleting a bank account of the organization is reported by this event too, with `changed_fields: ["bank_accounts"]`; the accounts (numbers) are never in the body, read them from the card `GET /v1/organizations/{organization}` with `organization_bank_account.view`. Editing the relation type catalog sends no events. A request that changes nothing sends no event. Linking or unlinking a contact or a deal is reported by `contact.updated` and `deal.updated`, not by this event. The realtime copy carries only `{"organization_id": 12}`.

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": "organization.updated",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-17T10:05:00.000000Z",
  "company_id": 1,
  "data": {
    "organization": {
      "id": 12,
      "name": "Альфа Трейд",
      "legal_name": "ТОО «Альфа Трейд»",
      "tax_id": "120340567891",
      "country_code": "KZ",
      "relation_type": { "id": 31, "name": "Клиент", "system_key": "customer" },
      "legal_form": "ТОО",
      "registration_code": null,
      "extra_codes": null,
      "signatory_name": "Иван Петров",
      "signatory_position": "Директор",
      "signatory_basis": "Устава",
      "phone": "+12025550142",
      "email": "office@example.com",
      "website": "https://example.com",
      "address": null,
      "comments": null,
      "responsible_user": { "id": 7, "name": "Anna Smith" },
      "source": "api",
      "custom_fields": { "segment": "wholesale" },
      "created_at": "2026-11-17T09:30:00.000000Z",
      "updated_at": "2026-11-17T10:05:00.000000Z"
    },
    "changed_fields": ["phone", "responsible_user_id"]
  }
}

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": "organization.updated",
  "event_id": "evt_01JXXXXXXXXXXXXXXXXXXXXX",
  "timestamp": "2026-11-17T10:05:00.000000Z",
  "company_id": 1,
  "data": {
    "organization": {
      "id": 12,
      "name": "Альфа Трейд",
      "legal_name": "ТОО «Альфа Трейд»",
      "tax_id": "120340567891",
      "country_code": "KZ",
      "relation_type": { "id": 31, "name": "Клиент", "system_key": "customer" },
      "legal_form": "ТОО",
      "registration_code": null,
      "extra_codes": null,
      "signatory_name": "Иван Петров",
      "signatory_position": "Директор",
      "signatory_basis": "Устава",
      "phone": "+12025550142",
      "email": "office@example.com",
      "website": "https://example.com",
      "address": null,
      "comments": null,
      "responsible_user": { "id": 7, "name": "Anna Smith" },
      "source": "api",
      "custom_fields": { "segment": "wholesale" },
      "created_at": "2026-11-17T09:30:00.000000Z",
      "updated_at": "2026-11-17T10:05:00.000000Z"
    },
    "changed_fields": ["phone", "responsible_user_id"]
  }
}

Payload fields

FieldTypeDescription
organization.idintegerOrganization ID
organization.namestringName
organization.legal_namestring|nullLegal name
organization.tax_idstring|nullBIN/IIN or INN, normalized (no spaces or dashes). For a sole proprietor it is the IIN of a person, i.e. personal data: the value travels in the webhook body and is kept in the webhook delivery log for its retention period, the same way as contact phone numbers
organization.country_codestring|nullTwo-letter ISO country code
organization.relation_typeobject|nullRelation type `{id, name, system_key}` or null; `system_key` is the permanent key of a starter type (`customer`, `prospect`, `partner`, `supplier`, `competitor`, `other`), null for the company custom types
organization.legal_formstring|nullLegal form (a free string)
organization.registration_codestring|nullRegistration code (OKPO and the like)
organization.extra_codesstring|nullOther codes as one string
organization.signatory_namestring|nullFull name of the head or signatory. Personal data: the value travels in the webhook body and is kept in the webhook delivery log for its retention period
organization.signatory_positionstring|nullPosition of the signatory. Together with the full name it is personal data
organization.signatory_basisstring|nullWhat the signatory acts on
organization.phonestring|nullPhone in E.164 format
organization.emailstring|nullE-mail, lower-case
organization.websitestring|nullWebsite
organization.addressstring|nullAddress
organization.commentsstring|nullComment (in full, not cut)
organization.responsible_userobject|nullResponsible user `{id, name}` or null
organization.sourcestring|nullWhere the organization came from: `manual`, `api`, `backfill` (`import`, `bitrix24`, `amocrm` are reserved)
organization.custom_fieldsobjectOrganization custom field values `{key: value}`; always an object, even an empty one
organization.created_atstringCreation time (ISO-8601)
organization.updated_atstringLast update time (ISO-8601)
changed_fieldsarrayNames of the changed fields (`name`, `tax_id`, `relation_type_id`, `legal_form`, `signatory_name`, `responsible_user_id` and so on); custom fields come as `custom.<key>`; a bank account change comes as `bank_accounts`