Generate a Document with Text
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.
Text values for the template placeholders are passed to the method documentgenerator.document.add via the values parameter without additional field type settings.
When to Use
- The template contains only text placeholders without type modifiers.
- There is no need to specify
TYPE,FORMAT, and providers infields.
What to Pass in the Request
values— an object of the form"FieldCode": "TextValue"fieldscan be omitted if all fields are inserted as plain text without formatting.
Keys in values must match the field codes from the template; for example, for the placeholder {SomeName}, you need to pass 'SomeName'.
You can obtain the field codes of the template using the method documentgenerator.template.getfields.
For REST calls, the provider Bitrix\\DocumentGenerator\\DataProvider\\Rest is used.
Example
$data = [
'templateId' => 203,
'providerClassName' => 'Bitrix\\DocumentGenerator\\DataProvider\\Rest',
'value' => 'ORDER_1024',
'values' => [
'DocumentNumber' => 'DG-2026-001',
'CurrentDate' => '03/18/2026',
'ClientName' => 'Acme Corp',
'Comment' => 'Payment within 5 business days after signing',
],
];
$url = $webHookUrl.'documentgenerator.document.add/';
Continue Learning
- Generate a Document with Date and Name Modifiers
- Generate a Document with Tabular Data
- Generate a Document with Complex Tables
- Generate a Document with Images and Stamps
- Typical use-cases and scenarios of the document generator: case overview
Copied