[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fdocuments\u002Fcrm-get":3,"docs-tabs-entities\u002Fdocuments\u002Fcrm-get":6},{"content":4,"lastmod":5},"## Get a CRM document\n\n`GET \u002Fv1\u002Fcrm-documents\u002F:id`\n\nReturns a document created for a CRM record by its ID, with its number, template field values and file links. A read-only key is accepted.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Document ID, a positive integer. Documents of a record: [`GET \u002Fv1\u002Fcrm-documents`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-list) |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961', {\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log(data.number, data.pdfUrlMachine ?? 'PDF is still being generated')\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961', {\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\nThe IDs `id`, `templateId`, `entityTypeId`, `entityId`, `createdBy` and `updatedBy` are returned as strings.\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | Always `true` on success |\n| `data.id` | string | Document ID |\n| `data.title` | string | Document title |\n| `data.number` | string | Document number |\n| `data.templateId` | string | Template ID. Templates for a record: [`GET \u002Fv1\u002Fcrm-document-templates\u002Favailable`](\u002Fdocs\u002Fentities\u002Fcrm-document-templates\u002Favailable) |\n| `data.entityTypeId` | string | Type of the CRM record the document is attached to. Values are in the \"CRM record types\" list on the [`GET \u002Fv1\u002Fcrm-documents`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-list) page |\n| `data.entityId` | string | ID of the CRM record the document is attached to |\n| `data.values` | object | Template field values passed on creation and update, along with service keys |\n| `data.stampsEnabled` | boolean | Stamps and signatures flag, see \"Known specifics\" |\n| `data.changeStampsEnabled` | boolean | Whether stamps and signatures can be enabled: `false` if the template has none |\n| `data.changeStampsDisabledReason` | string \\| null | Why stamps cannot be enabled. `null` if they can |\n| `data.qrCodeEnabled` | boolean | Whether the QR code is enabled in the document |\n| `data.changeQrCodeEnabled` | boolean | Whether the QR code can be enabled: `false` if the template has none |\n| `data.changeQrCodeDisabledReason` | string \\| null | Why the QR code cannot be enabled. `null` if it can |\n| `data.products.currencyId` | string | Currency of the document's products |\n| `data.products.totalSum` | string \\| number | Total of the document's products as a string, for example `\"0.00\"`. The number `0` if the `entityId` record does not exist |\n| `data.products.totalRows` | number | Number of product rows in the document |\n| `data.publicUrl` | string \\| null | Public link to the document. `null` until the link is enabled via [`POST \u002Fv1\u002Fcrm-documents\u002F:id\u002Fpublic-url`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-public-url) |\n| `data.isTransformationError` | boolean | Whether converting the document to PDF and image failed |\n| `data.emailDiskFile` | number | ID of the DOCX file copy on Drive. File: [`GET \u002Fv1\u002Ffiles\u002F:id`](\u002Fdocs\u002Fentities\u002Ffiles) |\n| `data.pullTag` | string | Service tag of the document |\n| `data.createTime` | string | Creation date in ISO 8601 format |\n| `data.updateTime` | string | Modification date in ISO 8601 format |\n| `data.createdBy` | string | Creator ID. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers) |\n| `data.updatedBy` | string \\| null | ID of the last editor. `null` if the document has not been modified. List: [`GET \u002Fv1\u002Fusers`](\u002Fdocs\u002Fentities\u002Fusers) |\n| `data.downloadUrl` | string | Link to the DOCX file for an employee in the browser |\n| `data.pdfUrl` | string | Link to the PDF for an employee in the browser. The field is absent while the PDF is being generated |\n| `data.imageUrl` | string | Link to the image for an employee in the browser. The field is absent while the image is being generated |\n| `data.downloadUrlMachine` | string | URL of [`\u002Fv1\u002Fcrm-documents\u002F:id\u002Fdownload`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fdownload). Requires `X-Api-Key` with the `crm` scope |\n| `data.pdfUrlMachine` | string | URL of [`\u002Fv1\u002Fcrm-documents\u002F:id\u002Fpdf`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fpdf). The field is absent while the PDF is being generated |\n| `data.imageUrlMachine` | string | URL of [`\u002Fv1\u002Fcrm-documents\u002F:id\u002Fimage`](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fimage). The field is absent while the image is being generated |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"changeStampsEnabled\": false,\n    \"changeStampsDisabledReason\": \"The template has no stamps or signatures\",\n    \"changeQrCodeEnabled\": false,\n    \"qrCodeEnabled\": false,\n    \"changeQrCodeDisabledReason\": \"The template has no QR code\",\n    \"products\": {\n      \"currencyId\": \"USD\",\n      \"totalSum\": \"0.00\",\n      \"totalRows\": 0\n    },\n    \"downloadUrl\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fbitrix\u002Fservices\u002Fmain\u002Fajax.php?action=crm.documentgenerator.document.download&SITE_ID=s1&id=1961\",\n    \"publicUrl\": null,\n    \"title\": \"Addresses A463\u002F\u002F10\u002F2026\",\n    \"number\": \"A463\u002F\u002F10\u002F2026\",\n    \"id\": \"1961\",\n    \"createTime\": \"2026-10-08T17:43:04+00:00\",\n    \"createdBy\": \"1317\",\n    \"updateTime\": \"2026-10-08T17:43:04+00:00\",\n    \"updatedBy\": null,\n    \"stampsEnabled\": true,\n    \"isTransformationError\": false,\n    \"values\": {\n      \"productsTableVariant\": \"\",\n      \"stampsEnabled\": true,\n      \"_creationMethod\": \"rest\"\n    },\n    \"templateId\": \"87\",\n    \"pullTag\": \"TRANSFORMDOCUMENT1961\",\n    \"imageUrl\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fbitrix\u002Fservices\u002Fmain\u002Fajax.php?action=crm.documentgenerator.document.getImage&SITE_ID=s1&id=1961\",\n    \"pdfUrl\": \"https:\u002F\u002Fexample.bitrix24.com\u002Fbitrix\u002Fservices\u002Fmain\u002Fajax.php?action=crm.documentgenerator.document.getPdf&SITE_ID=s1&id=1961\",\n    \"emailDiskFile\": 10365,\n    \"entityId\": \"8781\",\n    \"entityTypeId\": \"2\",\n    \"downloadUrlMachine\": \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961\u002Fdownload\",\n    \"imageUrlMachine\": \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961\u002Fimage\",\n    \"pdfUrlMachine\": \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcrm-documents\u002F1961\u002Fpdf\"\n  }\n}\n```\n\n## Error response example\n\n404 — no document with this `id` exists, or it was deleted:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Document not found\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer, for example `abc` or `0`. Message: `id must be a positive integer` |\n| 404 | `ENTITY_NOT_FOUND` | No document with this `id` exists, or it was deleted |\n| 502 | `BITRIX_INVALID_RESPONSE` | Bitrix24 responded without a document |\n| 403 | `BITRIX_ACCESS_DENIED` | No access to the CRM record the document is attached to, including when the record does not exist. Message: `Access denied` |\n| 403 | `SCOPE_DENIED` | The key lacks the `crm` scope |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `TOKEN_MISSING` | No tokens are mapped to the key: an OAuth application key was called without a user session |\n\nFull list of common API errors: [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n**Downloading before the file is ready.** While the `pdfUrlMachine` and `imageUrlMachine` fields are absent, downloading the PDF or image returns `409 DOCUMENT_NOT_READY`. Retry this method or the download itself every few seconds until the field appears.\n\n**`stampsEnabled` does not show whether the file has stamps.** For a document generated from a template, the method returns `stampsEnabled: true` even when the document was created or updated with `stampsEnabled: false` and the file was generated without stamps. The stamps flag the file was actually generated with is returned in the [create](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-create) and [update](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-update) responses.\n\n## See also\n\n- [Documents by CRM entity](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-list)\n- [Create a CRM document](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-create)\n- [Update a CRM document](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-update)\n- [Delete a CRM document](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fcrm-delete)\n- [Download document PDF](\u002Fdocs\u002Fentities\u002Fdocuments\u002Fpdf)\n- [Documents](\u002Fdocs\u002Fentities\u002Fdocuments)\n","2026-10-09",{},1794739373901]