Untuk agen AI: markdown halaman ini — /docs-content-en/entities/pages/block-nodes.md indeks dokumentasi — /llms.txt
Artikel dokumentasi saat ini tersedia dalam bahasa Inggris.
Block text and images
PATCH /v1/pages/:pageId/blocks/:blockId/nodes
Writes draft nodes. Strings or image/link objects or icon arrays. Text nodes require a string, integer or object with a text field of either type; ineffective values return 400. Service keys refused. Unknown selectors and indices are 400. Bitrix24 sanitizes script and event handlers; returns content read back. Numeric values must serialize as decimal integers within the PHP int64 range; values outside that range return 400 because Bitrix24 skips floats without changing text.
Requires landing scope; READONLY keys receive 403 before Bitrix24 is called.
Parameters
pageId and blockId: positive safe integers; the block must belong to the page. Optional query scope=KNOWLEDGE|GROUP|MAINPAGE selects the page context.
Selectors: .class or .class@N, with a zero-based index. The map must not be empty. Read available selectors from the block manifest; unknown-selector errors list available selectors.
Example
curl -X PATCH "https://vibecode.bitrix24.com/v1/pages/42/blocks/7/nodes" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"nodes":{".landing-block-node-title":"Title"}}'
Response
{
"success": true,
"data": {
"id": 7,
"pageId": 42,
"anchor": "chapter",
"content": "<h2 class=\"landing-block-node-title\">Title</h2>",
"nodes": {},
"styles": {},
"attrs": {},
"cards": {},
"active": true
}
}
HTML is a data string: sanitize it before rendering. nodes/styles/attrs/cards absent in the Bitrix24 response become empty objects; stored values are visible in content.
Errors
400 INVALID_PARAMS / MISSING_REQUIRED_FIELDS / INVALID_SCOPE; 403 SCOPE_DENIED / WRITE_BLOCKED_READONLY_KEY; 404 ENTITY_NOT_FOUND; 409 LANDING_MODULE_NOT_ENABLED / PORTAL_ADDRESS_CHANGED; 422 BITRIX_ERROR; 429, 502, 503.