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

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

Sites

Managing sites on the Bitrix24 platform: create, get, update, delete, search, aggregate. A site is a container of pages of one type: PAGE — landing page, STORE — online store, KNOWLEDGE — Knowledge Base 2.0. Each site has its own domain or subdomain in the Bitrix24 account, a symbolic code, a template, and a set of pages.

Knowledge Base 2.0 is created and managed through the same methods with an additional scope: "KNOWLEDGE" parameter (see create).

Bitrix24 API: landing.site.* Scope: landing

Create site

POST /v1/sites

Creates a new site in your Bitrix24 account. The site type is determined by the type field. Fields are passed flat at the root of the JSON — without the fields wrapper.

Request fields (body)

Parameter Type Required Description
Parametertitle Typestring Requiredyes DescriptionSite name, up to 255 characters
Parametertype Typestring Requiredno DescriptionSite type. Default PAGE — landing page. Also STORE — online store, KNOWLEDGE — Knowledge Base 2.0. For KNOWLEDGE you must also pass scope: "KNOWLEDGE" — see below
Parameterscope Typestring Requiredno DescriptionThe Bitrix24 section the site is created in: KNOWLEDGE (Knowledge Base 2.0), GROUP (group knowledge base) or MAINPAGE. Without it a regular landing site is created. To create a knowledge base, pass scope: "KNOWLEDGE" together with type: "KNOWLEDGE" — otherwise the server returns 403 BITRIX_ACCESS_DENIED ("Site creation access denied"). Can be passed as a body field or the ?scope=KNOWLEDGE query parameter. The same scope is needed when updating and deleting such a site
Parametercode Typestring Requiredyes DescriptionSymbolic site code in the URL. The key is required, but the value may be empty ("") or null — then the code is generated from title. If you omit the code key itself, creation returns 422 (see "The code key is required" in "Known specifics"). If the code consists only of digits, the site prefix is added. If the code is already taken on the domain, a numeric suffix is added (code2, code3)
ParameterdomainId Typenumber Requiredno DescriptionDomain identifier. If not provided, the address is generated from code on bitrix24site.com
Parameterdescription Typestring Requiredno DescriptionSite description, up to 255 characters
ParameterxmlId Typestring Requiredno DescriptionExternal identifier, up to 255 characters

Examples

curl — personal key

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/sites" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Conference landing",
    "code": "conf-2026",
    "type": "PAGE"
  }'

curl — OAuth application

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/sites" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Conference landing",
    "code": "conf-2026",
    "type": "PAGE"
  }'

curl — Knowledge Base 2.0 (`scope=KNOWLEDGE`)

Terminal
curl -X POST "https://vibecode.bitrix24.com/v1/sites" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Company knowledge base",
    "code": "company-knowledge-base",
    "type": "KNOWLEDGE",
    "scope": "KNOWLEDGE"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Conference landing',
    code: 'conf-2026',
    type: 'PAGE',
  }),
})

const { success, data } = await res.json()
console.log('Site ID:', data.id)

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites', {
  method: 'POST',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Conference landing',
    code: 'conf-2026',
    type: 'PAGE',
  }),
})

const { success, data } = await res.json()

Response fields

The full object of the created site is returned.

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionThe created site. All fields — Site fields
Fielddata.id Typenumber DescriptionIdentifier of the created site
Fielddata.title Typestring DescriptionSite name
Fielddata.code Typestring DescriptionActual symbolic code (with an auto-suffix if the requested code was taken)
Fielddata.type Typestring DescriptionSite type
Fielddata.active Typeboolean DescriptionAlways false for a just-created site
Fielddata.domainId Typenumber DescriptionDomain identifier (issued automatically or provided)
Fielddata.createdById Typenumber DescriptionIdentifier of the user who created the site. Lookup: GET /v1/users
Fielddata.dateCreate Typedatetime DescriptionCreation date
Fielddata.dateModify Typedatetime DescriptionLast modification date

The site URL in Bitrix24 is built from id:

https://<portal>.bitrix24.com/sites/site/<id>/

<portal> is the Bitrix24 portal domain. Access is restricted by the employee's permissions in Bitrix24.

Response example

JSON
{
  "success": true,
  "data": {
    "id": 173,
    "title": "Conference landing",
    "code": "/conf-2026/",
    "type": "PAGE",
    "active": false,
    "domainId": 28,
    "createdById": 1,
    "dateCreate": "07.05.2026 12:14:08",
    "dateModify": "07.05.2026 12:14:08"
  }
}

Error response example

422 — invalid site code:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "The site address is entered incorrectly. You may use only the following characters: \"a-z\", \"0-9\", \"-\", \".\"."
  }
}

Errors

HTTP error.code Marker in error.message Description
HTTP400 error.codeREADONLY_FIELD Marker in error.messageField 'active' is read-only DescriptionThe body carried active — the field is read-only (Bitrix24 does not store it). Drop it from the body; a site is activated by POST /v1/sites/:id/publication or by publishing it in the interface
HTTP422 error.codeBITRIX_ERROR Marker in error.messageRequired field "Site address" is not filled in DescriptionThe code key was omitted — the site has no address. Pass code with any value, even an empty one
HTTP422 error.codeBITRIX_ERROR Marker in error.messageSLASH_IS_NOT_ALLOWED DescriptionA / character was passed in code — slashes in the code are not allowed
HTTP422 error.codeBITRIX_ERROR Marker in error.messageDOMAIN_IS_INCORRECT DescriptionThe site address is entered incorrectly: only the characters a-z, 0-9, -, . are allowed
HTTP422 error.codeBITRIX_ERROR Marker in error.messageDOMAIN_EXIST DescriptionThe specified domain is already taken by another site
HTTP422 error.codeBITRIX_ERROR Marker in error.messageDOMAIN_EXIST_TRASH DescriptionThe domain is bound to a site in the trash — unbind it first
HTTP422 error.codeBITRIX_ERROR Marker in error.messageDOMAIN_NOT_FOUND DescriptionA domain with the specified domainId does not exist
HTTP422 error.codeBITRIX_ERROR Marker in error.messageSITE_LIMIT_REACHED DescriptionThe site count limit on the current plan has been reached
HTTP403 error.codeBITRIX_ACCESS_DENIED Marker in error.messageSite creation access denied DescriptionThe user does not have permission to create sites — OR a type: "KNOWLEDGE" site is being created without scope: "KNOWLEDGE" (add scope, see the fields table)
HTTP403 error.codeSCOPE_DENIED Marker in error.message— DescriptionThe API key does not have the landing scope
HTTP401 error.codeTOKEN_MISSING Marker in error.message— DescriptionThe API key has no configured tokens

The full list of common API errors — Errors.

Known specifics

Slashes in the response. The code field in the response is returned with leading and trailing slashes (/conf-2026/) — this is the representation of the site path in the URL. Slashes cannot be passed in the request.

The code key is required. The code value may be an empty string "" or null — then the code is generated from title. But if you omit the code key itself, creation returns 422 BITRIX_ERROR with the message Required field "Site address" is not filled in. If domainId is not provided, the address is generated from code on bitrix24site.com, for example b24-xxxxx.bitrix24site.com.

The active flag cannot be set through the API. The active field is read-only: Bitrix24 does not store the passed value on create or on update, so a request carrying it is refused with 400 READONLY_FIELD before the Bitrix24 call. A new site is always created inactive — active: false in the response; a site is activated by POST /v1/sites/:id/publication or by publishing it in the Bitrix24 account interface.

Home page and error pages. The landingIdIndex, landingId404, landingId503 fields are not set on create — there are no pages yet. Assign them via update after the site pages are created.

Knowledge Base 2.0. Created as a site with type: "KNOWLEDGE" AND scope: "KNOWLEDGE" — both fields are required. Without scope the server returns 403 BITRIX_ACCESS_DENIED, because Bitrix24 creates KNOWLEDGE-type sites only in the knowledge-base section (the same scope is available for list, get, update and delete — see the respective methods). The key's landing scope is sufficient. No separate knowledge-base scope is required.

See also