For AI agents: markdown of this page — /docs-content-en/entities/sites/update.md documentation index — /llms.txt

Update site

PATCH /v1/sites/:id

Updates the fields of an existing site. Pass only the fields you want to change, flat at the root of the JSON — without the fields wrapper.

The active field is read-only: Bitrix24 does not store the passed value, so a request carrying it is refused with 400 READONLY_FIELD before the Bitrix24 call. A site is activated by POST /v1/sites/:id/publication or by publishing it in the Bitrix24 account interface.

Parameters

Parameter Type Required Description
Parameterid (path) Typenumber Requiredyes DescriptionSite identifier
Parameterscope Typestring Requiredno DescriptionFor a site in the knowledge-base section, pass scope: "KNOWLEDGE" (the same value used when the site was created) — otherwise the server returns 403 BITRIX_ACCESS_DENIED ("Site edit access denied"). Can be passed as a body field or the ?scope=KNOWLEDGE query parameter. Not required for regular landing sites

Fields to update (body)

Parameter Type Description
Parametertitle Typestring DescriptionSite name, up to 255 characters
Parametercode Typestring DescriptionSymbolic site code in the URL. Slashes are not allowed. If the code consists only of digits, the site prefix is added
ParameterdomainId Typenumber DescriptionDomain identifier
Parametertype Typestring DescriptionSite type: PAGE, STORE or KNOWLEDGE
Parameterdescription Typestring DescriptionSite description, up to 255 characters
ParameterxmlId Typestring DescriptionExternal identifier, up to 255 characters
ParameterlandingIdIndex Typenumber DescriptionIdentifier of the site home page
ParameterlandingId404 Typenumber DescriptionIdentifier of the 404 error page
ParameterlandingId503 Typenumber DescriptionIdentifier of the 503 error page

Examples

curl — personal key

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/sites/157" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Promo landing — updated"
  }'

curl — OAuth application

Terminal
curl -X PATCH "https://vibecode.bitrix24.com/v1/sites/157" \
  -H "X-Api-Key: YOUR_APP_KEY" \
  -H "Authorization: Bearer USER_SESSION_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Promo landing — updated"
  }'

JavaScript — personal key

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/157', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_API_KEY',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Promo landing — updated',
  }),
})

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

JavaScript — OAuth application

javascript
const res = await fetch('https://vibecode.bitrix24.com/v1/sites/157', {
  method: 'PATCH',
  headers: {
    'X-Api-Key': 'YOUR_APP_KEY',
    'Authorization': 'Bearer USER_SESSION_TOKEN',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    title: 'Promo landing — updated',
  }),
})

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

Response fields

Field Type Description
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata Typeobject DescriptionThe updated site with all its fields. Field list and types — Site fields

Response example

JSON
{
  "success": true,
  "data": {
    "id": 157,
    "title": "Promo landing — updated",
    "code": "/promo/",
    "type": "PAGE",
    "active": false,
    "domainId": 5,
    "createdById": 1,
    "dateCreate": "12.09.2024 10:23:14",
    "dateModify": "07.05.2026 12:18:42"
  }
}

Error response example

403 — no permission to update this site:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ACCESS_DENIED",
    "message": "Access denied"
  }
}

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. Drop it from the body; a site is activated by POST /v1/sites/:id/publication or by publishing it in the interface
HTTP403 error.codeBITRIX_ACCESS_DENIED Marker in error.message— DescriptionNo permission to modify the site or the specified fields, or a site with this ID does not exist or is inaccessible — Bitrix24 responds "Access denied". For PATCH, 404 is not returned, unlike GET /v1/sites/:id
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 DescriptionAn incorrect domain name format was passed
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.messageCODE_IS_NOT_UNIQUE DescriptionThe site code is not unique within the domain
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

Full list of common API errors — Errors.

See also