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 |
Methods |
|
|
Where to Use |
In REST application scenarios, when templates and documents are within the |
In CRM scenarios, when the document is linked to a CRM object |
|
What to Pass During Generation |
|
|
|
Template Methods |
||
|
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:
- Prepare a
.docxtemplate file with field placeholders. - Create or select a numerator and region, if needed by the template.
- Upload the template using the documentgenerator.template.add or documentgenerator.template.update methods.
- Retrieve the template's field map using the documentgenerator.template.getfields method.
- Create a document using the documentgenerator.document.add method.
- Retrieve the document using the documentgenerator.document.get method if you need to check its status and obtain file links.
- Use documentgenerator.document.list if you need to find documents by template, external identifier, or other fields.
- Enable a public link using the documentgenerator.document.enablepublicurl method if the document needs to be accessed outside your Bitrix24.
- Update the document using the documentgenerator.document.update method or delete it using the documentgenerator.document.delete method if required by the scenario.
- Configure access permissions through the Roles and Permissions section if the application needs to manage access to templates and documents.
Typical Use-Cases and Scenarios
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:
documentgeneratorWho can execute methods: depending on the method
Documents
|
Method |
Description |
|
Creates a new document based on a template |
|
|
Modifies an existing document |
|
|
Retrieves a document by identifier |
|
|
Retrieves a list of documents |
|
|
Deletes a document |
|
|
Enables or disables a public link to the document |
|
|
Retrieves a list of document fields |
Templates
|
Method |
Description |
|
Uploads a new document template |
|
|
Updates an existing document template |
|
|
Returns a document template by identifier |
|
|
Returns a list of document templates by filter |
|
|
Deletes a document template |
|
|
Returns the field map of the template |
Numerators
|
Method |
Description |
|
Adds a numerator |
|
|
Modifies a numerator |
|
|
Retrieves a numerator by identifier |
|
|
Retrieves a list of numerators |
|
|
Deletes a numerator |
Regions
|
Method |
Description |
|
Adds a custom region |
|
|
Updates a custom region |
|
|
Returns region data by identifier or code |
|
|
Returns a list of pre-installed and custom regions |
|
|
Deletes a custom region |
Roles and Permissions
|
Method |
Description |
|
Adds a role and returns its data with permissions |
|
|
Updates a role and returns the current role data |
|
|
Returns a role by identifier along with permissions |
|
|
Returns a list of roles without detailed permission composition |
|
|
Deletes a role by identifier |
|
|
Completely overwrites role bindings to access codes |