Document Generator: Overview of Methods

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.

The Document Generator compiles ready-made documents based on .docx templates and application data. It assists in uploading templates, retrieving their field maps, creating documents from them, and managing generation settings.

Quick Navigation: All Methods

How to Choose a Scenario

In Bitrix24, there are two groups of methods for working with the Document Generator: documentgenerator.* and crm.documentgenerator.*.

Templates, documents, and input data created through documentgenerator.* do not provide access to CRM data. For CRM scenarios, use the section Document Generator in CRM.

Methods documentgenerator.*

Methods crm.documentgenerator.*

Where to Use

In REST application scenarios, when templates and documents are within the documentgenerator scope

In CRM scenarios, when the document is linked to a CRM object

What to Pass During Generation

  • value — external ID of the object for which the document is created
  • providerClassName — data provider class

  • entityId — CRM object identifier
  • entityTypeId — CRM object type

Template Methods

documentgenerator.template.*

crm.documentgenerator.template.*

Where Results are Visible

At the REST level and in application logic

In scenarios and the CRM interface

How to Get Started

To work with documents in the Document Generator REST scenario:

  1. Prepare a .docx template file with field placeholders.
  2. Create or select a numerator and region, if needed by the template.
  3. Upload the template using the documentgenerator.template.add or documentgenerator.template.update methods.
  4. Retrieve the template's field map using the documentgenerator.template.getfields method.
  5. Create a document using the documentgenerator.document.add method.
  6. Retrieve the document using the documentgenerator.document.get method if you need to check its status and obtain file links.
  7. Use documentgenerator.document.list if you need to find documents by template, external identifier, or other fields.
  8. Enable a public link using the documentgenerator.document.enablepublicurl method if the document needs to be accessed outside your Bitrix24.
  9. Update the document using the documentgenerator.document.update method or delete it using the documentgenerator.document.delete method if required by the scenario.
  10. Configure access permissions through the Roles and Permissions section if the application needs to manage access to templates and documents.

Connection with Other Objects

Document Templates. A template specifies the .docx file, region, numerator, and a set of settings that are then used when creating a document. To work with templates, use the group of methods documentgenerator.template.*.

Numerators. A numerator defines the rule for generating the document number, which the template uses through the numeratorId field. You can work with numerators using the group of methods documentgenerator.numerator.*.

Regions. A region specifies the local settings for the template through the region field. Use code for a pre-installed region and id for a custom one. Management of regions is performed using the group of methods documentgenerator.region.*.

Roles and Permissions. Access permissions determine who can modify templates, documents, and settings of the Document Generator. To configure roles, use the group of methods documentgenerator.role.*.

Feature of Document Conversion to PDF

The conversion of a file to PDF is performed asynchronously. If the pdfUrl field is not filled immediately after the document is created, call the documentgenerator.document.get method to check the conversion result again.

Overview of Methods

Scope: documentgenerator

Who can execute methods: depending on the method

Documents

Method

Description

documentgenerator.document.add

Creates a new document based on a template

documentgenerator.document.update

Modifies an existing document

documentgenerator.document.get

Retrieves a document by identifier

documentgenerator.document.list

Retrieves a list of documents

documentgenerator.document.delete

Deletes a document

documentgenerator.document.enablepublicurl

Enables or disables a public link to the document

documentgenerator.document.getfields

Retrieves a list of document fields

Templates

Method

Description

documentgenerator.template.add

Uploads a new document template

documentgenerator.template.update

Updates an existing document template

documentgenerator.template.get

Returns a document template by identifier

documentgenerator.template.list

Returns a list of document templates by filter

documentgenerator.template.delete

Deletes a document template

documentgenerator.template.getfields

Returns the field map of the template

Numerators

Method

Description

documentgenerator.numerator.add

Adds a numerator

documentgenerator.numerator.update

Modifies a numerator

documentgenerator.numerator.get

Retrieves a numerator by identifier

documentgenerator.numerator.list

Retrieves a list of numerators

documentgenerator.numerator.delete

Deletes a numerator

Regions

Method

Description

documentgenerator.region.add

Adds a custom region

documentgenerator.region.update

Updates a custom region

documentgenerator.region.get

Returns region data by identifier or code

documentgenerator.region.list

Returns a list of pre-installed and custom regions

documentgenerator.region.delete

Deletes a custom region

Roles and Permissions

Method

Description

documentgenerator.role.add

Adds a role and returns its data with permissions

documentgenerator.role.update

Updates a role and returns the current role data

documentgenerator.role.get

Returns a role by identifier along with permissions

documentgenerator.role.list

Returns a list of roles without detailed permission composition

documentgenerator.role.delete

Deletes a role by identifier

documentgenerator.role.fillaccesses

Completely overwrites role bindings to access codes