Documents: Overview of Methods
Documents in the Bitrix24 document generator can be created from a template for a CRM entity or uploaded as a ready-made file and attached to a CRM entity.
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 methods and events
User documentation: Documents in CRM: Create and send to customers
Getting Started
- Prepare the document template and obtain the
templateIdin the Document Templates section. - Determine the
entityTypeIdof the CRM entity for which the document is needed. - Obtain the
entityIdof the required CRM entity. - If you need to check the available document fields, use the crm.documentgenerator.document.getfields method.
- Create a document from the template using the crm.documentgenerator.document.add method or upload a ready-made file using the crm.documentgenerator.document.upload method.
- If you know the document's
idand want to retrieve its data, use the crm.documentgenerator.document.get method. - If you need to get a list of documents, use the crm.documentgenerator.document.list method.
- To modify a document, use the crm.documentgenerator.document.update method.
- If you need a public link to the document, use the crm.documentgenerator.document.enablepublicurl method.
- Delete an unnecessary document using the crm.documentgenerator.document.delete method.
Typical use-cases and scenarios
Important Considerations
The pdfUrl and imageUrl links may not be available immediately after creating or updating the document, as the conversion is performed asynchronously. If you need the links right away, repeat the request using the crm.documentgenerator.document.get method after 30-40 seconds.
Relationships with Other Objects
Document Templates. To create a document from a template, pass the templateId to the crm.documentgenerator.document.add method. Obtain the templateId from the response of crm.documentgenerator.template.add or retrieve it from the list using the crm.documentgenerator.template.list method.
CRM Entities. To create or upload a document, pass the entityTypeId and entityId. Typical values for entityTypeId for CRM entities are provided in the article Features of Passed Values. For SPAs, the entityTypeId can be obtained using the crm.type.list method. The identifier of the required object, entityId, can be obtained using the universal crm.item.list method.
Numbering. When creating a document, the number is usually generated based on the numbering system associated with the template. If you are creating a new numbering system, obtain the id from the response of crm.documentgenerator.numerator.add. If you are using an existing one, retrieve the id using the crm.documentgenerator.numerator.list method.
Files. In the crm.documentgenerator.document.upload method, the file content is passed in Base64. The upload format is described in the article How to Upload Files.
Overview of Methods and Events
Scope:
crmWho can execute the method: depends on the method
|
Method |
Description |
|
Creates a document from a template |
|
|
Updates a document |
|
|
Returns information about the document |
|
|
Returns a list of documents |
|
|
Deletes a document |
|
|
Enables or disables a public link |
|
|
Uploads a ready document and attaches it to a CRM entity |
|
|
Returns the fields of the created document |
|
Event |
Triggered |
|
When generating a document manually or using the crm.documentgenerator.document.add method |
|
|
When modifying a document manually or using the crm.documentgenerator.document.update method |
|
|
When deleting a document manually or using the crm.documentgenerator.document.delete method |