[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fpages\u002Fblock-content":3,"docs-tabs-entities\u002Fpages\u002Fblock-content":6},{"content":4,"lastmod":5},"## Read block content\n\n`GET \u002Fv1\u002Fpages\u002F:pageId\u002Fblocks\u002F:blockId\u002Fcontent`\n\nReturns the HTML of a page block and the data for editing it. The draft is always read, so unpublished changes are visible too.\n\nRequires the `landing` scope. A read-only key works. No request body is sent.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `pageId` (path) | number | yes | Page ID. List: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n| `blockId` (path) | number | yes | ID of a block on page `pageId`. List: [`GET \u002Fv1\u002Fpages\u002F:pageId\u002Fblocks`](\u002Fdocs\u002Fentities\u002Fpages\u002Fblocks\u002Flist) |\n| `scope` (query) | string | no | Site type: `KNOWLEDGE` — knowledge base, `GROUP` — workgroup site, `MAINPAGE` — main page. Omit the parameter for pages of other sites |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F3\u002Fblocks\u002F4975\u002Fcontent\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F3\u002Fblocks\u002F4975\u002Fcontent\" \\\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 response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F3\u002Fblocks\u002F4975\u002Fcontent\", {\n  headers: {\"X-Api-Key\": \"YOUR_API_KEY\"},\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F3\u002Fblocks\u002F4975\u002Fcontent\", {\n  headers: {\"X-Api-Key\": \"YOUR_APP_KEY\", \"Authorization\": \"Bearer USER_SESSION_TOKEN\"},\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | Block content |\n| `data.html` | string | Block HTML inside a container with the `block-wrapper` class |\n| `data.anchor` | string | Block anchor. Optional field |\n| `data.nodes` | object \\| array | Description of editable nodes: the key is the node's CSS selector. Optional field |\n| `data.cards` | object \\| array | Description of block cards: the key is the card's CSS selector. Optional field |\n| `data.style` | object \\| array | Available styles of the block and its nodes. Optional field |\n| `data.attrs` | object \\| array | Editable node attributes. Optional field |\n| `data.css` | array | Paths to the block's CSS files. Optional field |\n| `data.js` | array | Paths to the block's JavaScript files. Optional field |\n| `data.php` | boolean | `true` — the block contains PHP code, and editing its content is restricted. Optional field |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"html\": \"\u003Cdiv id=\\\"block4975\\\" data-id=\\\"4975\\\" class=\\\"block-wrapper block-26-3-separator\\\">\u003Cdiv class=\\\"landing-block g-pt-0 g-pb-0 g-height-70 g-my-minus-2 g-fill-first g-fill-second g-height-50--md landing-block-separator\\\" style=\\\"--fill-first: #ffffff;--fill-second: hsla(0, 0%, 86%, 1);\\\">\\r\\n\\t\u003Csvg class=\\\"g-width-100x g-height-100x\\\" viewbox=\\\"0 0 1100 200\\\" preserveaspectratio=\\\"none\\\" xmlns=\\\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\\\">\\r\\n\\t\\t\u003Cpath class=\\\"fill-first\\\" d=\\\"M0 0H1100V2V3H1097.19L550 198L2.80612 3H0V2V0Z\\\" \u002F>\\r\\n\\t\\t\u003Cpath class=\\\"fill-second\\\" d=\\\"M1100 197V198V200H0V198V197V2L547.194 197H552.806L1100 2V197Z\\\" \u002F>\\r\\n\\t\u003C\u002Fsvg>\\r\\n\u003C\u002Fdiv>\u003C\u002Fdiv>\",\n    \"nodes\": [],\n    \"cards\": [],\n    \"style\": {\n      \"block\": {\n        \"type\": [\n          \"display\",\n          \"fill-first\",\n          \"fill-second\",\n          \"height-increased--md\"\n        ]\n      },\n      \"nodes\": []\n    },\n    \"attrs\": [],\n    \"anchor\": \"b4975\",\n    \"css\": [],\n    \"js\": [\n      \"\u002Fbitrix\u002Fjs\u002Fpull\u002Fprotobuf\u002Fprotobuf.min.js?178773668523214\",\n      \"\u002Fbitrix\u002Fjs\u002Fpull\u002Fprotobuf\u002Fmodel.min.js?178773668521204\",\n      \"\u002Fbitrix\u002Fjs\u002Fmain\u002Fcore\u002Fcore_promise.min.js?17906071592494\",\n      \"\u002Fbitrix\u002Fjs\u002Frest\u002Fclient\u002Frest.client.min.js?16015491189240\",\n      \"\u002Fbitrix\u002Fjs\u002Fpull\u002Fclient\u002Fpull.client.min.js?174471771449849\"\n    ],\n    \"php\": false\n  }\n}\n```\n\n## Error response example\n\n404 — there is no such block on page `pageId`:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Block or page not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | `Block or page not found.` — no block or page with these IDs exists, or the block belongs to another page |\n| 400 | `INVALID_PARAMS` | `pageId and blockId must be positive safe integers.` — `pageId` or `blockId` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 502 | `BITRIX_INVALID_RESPONSE` | `Bitrix24 returned an invalid block.`, `Bitrix24 returned a different block.` or `Bitrix24 returned invalid block content.` — Bitrix24 returned an unexpected result |\n| 502 | `BITRIX_INVALID_RESPONSE` | `Bitrix24 block response exceeds the 8 MiB limit.` — the Bitrix24 response is larger than 8 MiB |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the request. The error text comes from Bitrix24 |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user the key was issued for has no permission to read the page |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` is not found or has been revoked |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on the Bitrix24 account |\n| 409 | `PORTAL_ADDRESS_CHANGED` | The on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook |\n| 429 | `RATE_LIMITED` | The Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 did not respond or responded with a server error |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in the allotted time |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **An empty dictionary comes back as an empty array.** For a block without nodes, cards or attributes, the `nodes`, `cards` and `attrs` fields are `[]`, not `{}`. Check the type before iterating over keys.\n- **Editing data is filled in from the manifest.** A `nodes`, `cards`, `style` or `attrs` field missing from the top level of the Bitrix24 response is taken from the block manifest.\n- **Links with credentials are hidden.** A response string that contains a Bitrix24 webhook URL or a token in URL parameters comes back as `[REDACTED]`. If such a URL is in the HTML, the whole `html` is replaced with `[REDACTED]`.\n\n## See also\n\n- [Read a page block](\u002Fdocs\u002Fentities\u002Fpages\u002Fblock-get)\n- [List page blocks](\u002Fdocs\u002Fentities\u002Fpages\u002Fblocks\u002Flist)\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n","2026-10-21",{},1795415267712]