لوكلاء AI: ملف markdown لهذه الصفحة — /docs-content-en/entities/pages/block-get.md فهرس التوثيق — /llms.txt

مقالات التوثيق متاحة حاليًا باللغة الإنجليزية فقط.

Read a page block

GET /v1/pages/:pageId/blocks/:blockId

Returns the metadata of one page block. The draft is always read, so unpublished blocks are visible too.

Requires the landing scope. A read-only key works. No request body is sent.

Parameters

Parameter Type Required Description
ParameterpageId (path) Typenumber Requiredyes DescriptionPage ID. List: GET /v1/pages
ParameterblockId (path) Typenumber Requiredyes DescriptionID of a block on page pageId. List: GET /v1/pages/:pageId/blocks
Parameterscope (query) Typestring Requiredno DescriptionSite type: KNOWLEDGE — knowledge base, GROUP — workgroup site, MAINPAGE — main page. Omit the parameter for pages of other sites

Examples

curl — personal key

Terminal
curl "https://vibecode.bitrix24.com/v1/pages/3/blocks/4975" \
  -H "X-Api-Key: YOUR_API_KEY"

curl — OAuth application

Terminal
curl "https://vibecode.bitrix24.com/v1/pages/3/blocks/4975" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN"

JavaScript — personal key

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/3/blocks/4975", {
  headers: {"X-Api-Key": "YOUR_API_KEY"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

JavaScript — OAuth application

javascript
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/3/blocks/4975", {
  headers: {"X-Api-Key": "YOUR_APP_KEY", "Authorization": "Bearer USER_SESSION_TOKEN"},
})
const result = await response.json()
if (!response.ok) throw new Error(result.error.message)
console.log(result.data)

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionBlock metadata
Fielddata.id Typenumber DescriptionBlock ID
Fielddata.pageId Typenumber DescriptionID of the page the block belongs to
Fielddata.code Typestring DescriptionBlock code from the catalog. List of codes: GET /v1/block-repository
Fielddata.name Typestring DescriptionBlock name
Fielddata.active Typeboolean DescriptionWhether the block is active in the page draft
Fielddata.dateCreate Typestring | null DescriptionCreation date in ISO 8601 format without a timezone — the Bitrix24 account's local time
Fielddata.dateModify Typestring | null DescriptionLast modification date in the same format
Fielddata.createdById Typenumber | null DescriptionID of the employee who created the block. List: GET /v1/users
Fielddata.modifiedById Typenumber | null DescriptionID of the employee who last modified the block. List: GET /v1/users

Response example

JSON
{
  "success": true,
  "data": {
    "id": 4975,
    "pageId": 3,
    "code": "26.3.separator",
    "name": "Downward color transition",
    "active": true,
    "dateCreate": "2021-11-25T19:12:32",
    "dateModify": "2026-02-09T23:01:30",
    "createdById": 1,
    "modifiedById": null
  }
}

Error response example

404 — the block belongs to another page:

JSON
{
  "success": false,
  "error": {
    "code": "ENTITY_NOT_FOUND",
    "message": "Block not found in this page."
  }
}

Errors

HTTP Code Description
HTTP404 CodeENTITY_NOT_FOUND DescriptionBlock not found in this page. — the block exists but belongs to another page
HTTP404 CodeENTITY_NOT_FOUND DescriptionBlock or page not found. — no block or page with these IDs exists
HTTP400 CodeINVALID_PARAMS DescriptionpageId and blockId must be positive safe integers. — pageId or blockId is not a positive integer
HTTP400 CodeINVALID_SCOPE Descriptionscope is not KNOWLEDGE, GROUP or MAINPAGE
HTTP502 CodeBITRIX_INVALID_RESPONSE DescriptionBitrix24 returned an invalid block. or Bitrix24 returned a different block. — Bitrix24 returned an unexpected result
HTTP502 CodeBITRIX_INVALID_RESPONSE DescriptionBitrix24 block response exceeds the 8 MiB limit. — the Bitrix24 response is larger than 8 MiB
HTTP422 CodeBITRIX_ERROR DescriptionBitrix24 rejected the request. The error text comes from Bitrix24
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the landing scope
HTTP403 CodeBITRIX_ACCESS_DENIED DescriptionThe Bitrix24 user the key was issued for has no permission to read the page
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no configured tokens
HTTP401 CodeMISSING_API_KEY DescriptionThe X-Api-Key header is missing
HTTP401 CodeINVALID_API_KEY DescriptionThe key in X-Api-Key is not found or has been revoked
HTTP409 CodeLANDING_MODULE_NOT_ENABLED DescriptionThe Sites module is unavailable on the Bitrix24 account
HTTP409 CodePORTAL_ADDRESS_CHANGED DescriptionThe on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook
HTTP429 CodeRATE_LIMITED DescriptionThe Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds
HTTP502 CodeBITRIX_UNAVAILABLE DescriptionBitrix24 did not respond or responded with a server error
HTTP503 CodeBITRIX_TIMEOUT DescriptionBitrix24 did not respond in the allotted time

Full list of common API errors — Errors.

Known specifics

  • Links with credentials are hidden. A response string that contains a Bitrix24 webhook URL or a token in the URL query parameters comes back as [REDACTED].

See also