สำหรับเอเจนต์ AI: markdown ของหน้านี้ — /docs-content-en/entities/pages/block-get.md ดัชนีเอกสาร — /llms.txt
บทความในเอกสารมีให้บริการเป็นภาษาอังกฤษในขณะนี้
Read a page block
GET /v1/pages/:pageId/blocks/:blockId
Returns only the declared block metadata. The block must belong to pageId; a block from another page returns 404. Always uses params.edit_mode=1, so unpublished blocks are visible. Dates are ISO wall clocks without an invented timezone offset.
Requires the landing scope. READONLY keys can read. Optional query scope=KNOWLEDGE|GROUP|MAINPAGE selects the page context. No body is accepted by the contract. Credential-bearing strings are replaced with [REDACTED], including the entire HTML string if needed. The Bitrix24 response is bounded to 8 MiB; exceeding the limit returns 502.
Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
pageId |
integer | yes | Positive safe page ID from Pages. |
blockId |
integer | yes | Positive safe block ID belonging to this page. |
scope |
string | no | KNOWLEDGE, GROUP or MAINPAGE; omit for an ordinary site. |
Examples
curl — personal key
curl "https://vibecode.bitrix24.com/v1/pages/20/blocks/30" \
-H "X-Api-Key: YOUR_API_KEY"
curl — OAuth application
curl "https://vibecode.bitrix24.com/v1/pages/20/blocks/30" \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN"
JavaScript — personal key
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/20/blocks/30", {
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
const response = await fetch("https://vibecode.bitrix24.com/v1/pages/20/blocks/30", {
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 |
|---|---|---|
success |
boolean | true |
data |
object | Operation result. |
data.id |
integer | Block ID. |
data.pageId |
integer | Owning page ID. |
data.code |
string | Block code. |
data.name |
string | Block name. |
data.active |
boolean | Block is active in the draft. |
data.dateCreate |
string or null | ISO wall clock, no invented timezone. |
data.dateModify |
string or null | ISO wall clock, no invented timezone. |
data.createdById |
integer or null | Creator user ID. |
data.modifiedById |
integer or null | Last editor user ID. |
Response
{
"success": true,
"data": {
"id": 30,
"pageId": 20,
"code": "01.big_with_text_3",
"name": "Example",
"active": true,
"dateCreate": "2026-10-05T14:41:37",
"dateModify": "2026-10-05T14:41:37",
"createdById": 42,
"modifiedById": 42
}
}
Errors
| HTTP | Code | Condition |
|---|---|---|
| 400 | INVALID_PARAMS |
Invalid pageId/blockId or blank code. |
| 400 | INVALID_SCOPE |
Invalid scope. |
| 401 | TOKEN_MISSING |
No Bitrix24 credentials. |
| 403 | SCOPE_DENIED |
Key lacks landing scope. |
| 403 | BITRIX_ACCESS_DENIED |
Bitrix24 user lacks permission. |
| 404 | ENTITY_NOT_FOUND |
Block not in this page, missing sample or manifest file. |
| 409 | LANDING_MODULE_NOT_ENABLED |
The Sites module is unavailable on this Bitrix24 account. |
| 422 | BITRIX_ERROR |
Bitrix24 business refusal; message preserved. |
| 502 | BITRIX_INVALID_RESPONSE |
Unexpected result or Bitrix24 response exceeds 8 MiB. |