Untuk agen AI: markdown halaman ini — /docs-content-en/entities/sites/template-areas.md indeks dokumentasi — /llms.txt

Artikel dokumentasi saat ini tersedia dalam bahasa Inggris.

Template areas

Requires the landing key scope. Every route accepts optional query scope=KNOWLEDGE, GROUP or MAINPAGE; omit it for ordinary sites. All IDs are positive safe integers. Writes with READONLY keys are refused before any portal call.

PATCH merges the non-empty areas dictionary with existing areas. A missing area stays unchanged; null removes only that area. The underlying Bitrix24 set method fully replaces all areas, so V1 sends the merged set. Use explicit DELETE to clear all areas. Page IDs must exist and be visible, but they may belong to another site. Page areas override site areas. Concurrent V1 writers are refused with 409 TEMPLATE_AREAS_BUSY; retry after the other update. External portal edits cannot be serialized by V1. The layout itself can be set with PATCH /v1/pages/:id {tplId: 7}; sites.tplId is read-only, so generic site PATCH cannot change it.

Operations

  • GET /v1/sites/:id/template-areas — landing.template.getSiteRef.
  • PATCH /v1/sites/:id/template-areas — landing.template.setSiteRef.
  • DELETE /v1/sites/:id/template-areas — landing.template.setSiteRef.

Example

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/sites/42/template-areas" -H "X-Api-Key: YOUR_API_KEY" -H 'Content-Type: application/json' -d '{"areas": {"1": 614, "2": null}}'

Response

JSON
{
  "success": true,
  "data": {
    "areas": {
      "1": 614
    }
  }
}

Empty bindings return []; empty areas return {areas:{}}. Writes return the persisted state. Bitrix24 true is insufficient: a mismatched reread returns 422 BITRIX_ERROR.

Errors

400 INVALID_PARAMS / INVALID_SCOPE / MISSING_REQUIRED_FIELDS; 401 TOKEN_MISSING; 403 SCOPE_DENIED / BITRIX_ACCESS_DENIED / WRITE_BLOCKED_READONLY_KEY; 404 ENTITY_NOT_FOUND; 409 PORTAL_ADDRESS_CHANGED / LANDING_MODULE_NOT_ENABLED / TEMPLATE_AREAS_BUSY; 422 BITRIX_ERROR; 429 rate limits; 502 / 503 transport failures.

Area numbers are signed 32-bit integers, including 0 and -1; normalized decimal keys appear in the response.