สำหรับเอเจนต์ AI: markdown ของหน้านี้ — /docs-content-en/entities/pages/block-anchor.md ดัชนีเอกสาร — /llms.txt

บทความในเอกสารมีให้บริการเป็นภาษาอังกฤษในขณะนี้

Block anchor

PUT /v1/pages/:pageId/blocks/:blockId/anchor

Empty anchor removes it. Returns anchor and content read back.

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.

Example

Terminal
curl -X PUT "https://vibecode.bitrix24.com/v1/pages/42/blocks/7/anchor" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"anchor":"chapter"}'

Response

JSON
{
  "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.