[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fpages\u002Fcatalog-content":3,"docs-tabs-entities\u002Fpages\u002Fcatalog-content":6},{"content":4,"lastmod":5},"## Read a catalog sample\n\n`GET \u002Fv1\u002Fblock-repository\u002F:code\u002Fcontent`\n\nReturns the HTML sample of a block from the block catalog. The sample shows the markup and node classes before the block is added to a page.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `code` (path) | string | yes | Catalog block code without the `bitrix:` prefix, for example `27.3.one_col_fix_title`. A code with the prefix returns `404`. To get the list, call [`GET \u002Fv1\u002Fblock-repository`](\u002Fdocs\u002Fentities\u002Fpages\u002Fcatalog): the code is the key of an element in a section's `items`. It comes without the prefix and can be passed as is. Application block codes `repo_N` and \"My blocks\" template codes of the form `sourceCode@blockId` are also accepted. Encode the `@` character with `encodeURIComponent` |\n| `scope` (query) | string | no | Internal landing area: `KNOWLEDGE` — knowledge base, `GROUP` — group knowledge base, `MAINPAGE` — home page. Omit it for a regular site |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fblock-repository\u002F27.3.one_col_fix_title\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\u002Fblock-repository\u002F27.3.one_col_fix_title\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 code = encodeURIComponent(\"27.3.one_col_fix_title\")\nconst response = await fetch(`https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fblock-repository\u002F${code}\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 code = encodeURIComponent(\"27.3.one_col_fix_title\")\nconst response = await fetch(`https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fblock-repository\u002F${code}\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.code` | string | Block code in the form it was passed in the path |\n| `data.html` | string | HTML sample of the block. If the markup contains an address with credentials, the whole string is replaced with `[REDACTED]` |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"code\": \"27.3.one_col_fix_title\",\n    \"html\": \"\u003Csection class=\\\"landing-block js-animation g-pt-30 g-pb-30\\\">\\n\\t\u003Ch2 class=\\\"landing-block-node-title js-animation fadeIn g-my-0 container g-max-width-container g-pl-15 g-pr-15 g-color\\\">The title\u003C\u002Fh2>\\n\u003C\u002Fsection>\"\n  }\n}\n```\n\n## Error response example\n\n404 — there is no sample with this code, or the code was passed with the `bitrix:` prefix:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Block sample not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | `Block sample not found.` — there is no sample with this code, or the code was passed with the `bitrix:` prefix |\n| 404 | `ENTITY_NOT_FOUND` | `Block or page not found.` — the catalog of the current Bitrix24 account has no block with this code. Which of the two messages arrives depends on the step at which the block was not found |\n| 400 | `INVALID_PARAMS` | `code must be a non-empty block code.` — `code` is empty or contains only spaces |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 502 | `BITRIX_INVALID_RESPONSE` | `Bitrix24 returned an invalid block sample.` — Bitrix24 returned a sample that is not a string |\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 on whose behalf the key was issued has no permission to read the catalog |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` was not found or has been revoked |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\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 was 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 within the allotted time |\n\nFull list of common API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Application blocks are read from the current Bitrix24 account.** The `repo_N` code refers to blocks that applications added to the catalog of the current Bitrix24 account.\n- **A read-only key works.** The method only reads data, so a key in read-only mode gets a response.\n\n## See also\n\n- [Block catalog](\u002Fdocs\u002Fentities\u002Fpages\u002Fcatalog)\n- [Catalog manifest](\u002Fdocs\u002Fentities\u002Fpages\u002Fcatalog-manifest)\n- [Add a block to a page](\u002Fdocs\u002Fentities\u002Fpages\u002Fblocks\u002Fcreate)\n- [Saved blocks](\u002Fdocs\u002Fentities\u002Fblock-repository)\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n","2026-10-20",{},1795415271941]