Overview of Events When Working with Documents

Events allow applications to respond to changes in near real-time, providing notifications for the creation, updating, or deletion of documents in the CRM Document Generator.

Detailed information on working with events is described in the article Concept and Benefits of Event Processing.

If you are developing integrations for Bitrix24 using AI tools (Codex, Claude Code, Cursor), connect to the MCP server so that the assistant can utilize the official REST documentation.

Quick Navigation: All Events

What the Handler Receives

All three events pass the same set of fields in data.FIELDS:

  • ID — identifier of the document. Use it to retrieve the document data with the method crm.documentgenerator.document.get
  • ENTITY_TYPE_ID — identifier of the CRM object type the document is linked to, for example 1 — lead
  • ENTITY_ID — identifier of the CRM object itself

The document file and links to it are not passed in the event. To retrieve pdfUrl, imageUrl, or the public link, call crm.documentgenerator.document.get with the received ID.

How to Receive Events

You can subscribe to document events through:

An example of a handler code for the event is described in the article How to Test Your Handler for Event Processing in Bitrix24.

Server Availability for Sending and Receiving Events

The event handler server must be accessible from the outside. To configure the accessibility of the event handler server and application, refer to the article Required network access.

For cloud Bitrix24, no additional configuration is required. For on-premise Bitrix24, configure accessibility on the server or hosting according to the article Required network access.

Overview of Events

Scope: crm

Who can subscribe: any user

Event

Triggered By

onCrmDocumentGeneratorDocumentAdd

When a document is generated manually or by the methods crm.documentgenerator.document.add and crm.documentgenerator.document.upload

onCrmDocumentGeneratorDocumentUpdate

When a document is modified manually or by the method crm.documentgenerator.document.update

onCrmDocumentGeneratorDocumentDelete

When a document is deleted manually or by the method crm.documentgenerator.document.delete