[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fsites\u002Frestore":3,"docs-tabs-entities\u002Fsites\u002Frestore":6},{"content":4,"lastmod":5},"## Restore a site\n\n`POST \u002Fv1\u002Fsites\u002F:id\u002Frestore`\n\nBrings a site back from the trash.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|---------|\n| `id` (path) | number | yes | Site ID, a positive integer. Sites in the trash: [`GET \u002Fv1\u002Fsites?filter[deleted]=Y`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) |\n| `scope` (query) | string | no | Internal landing scope: `KNOWLEDGE` \u002F `GROUP` \u002F `MAINPAGE`. Pass it if the site belongs to that scope. Otherwise `404 ENTITY_NOT_FOUND` is returned |\n\nThe request body is empty or `{}`. Any field in the body is rejected with `400 INVALID_PARAMS`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Frestore\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\"\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Frestore\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\"\n```\n\n### JavaScript — personal key\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Frestore', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n  },\n})\n\nconst { success, data } = await res.json()\nconsole.log('In trash:', data.deleted)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst res = await fetch('https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fsites\u002F233\u002Frestore', {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n  },\n})\n\nconst { success, data } = await res.json()\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|---------|\n| `success` | boolean | `true` on success |\n| `data.id` | number | Site ID |\n| `data.active` | boolean | Whether the site is published. After restoring — `false` |\n| `data.deleted` | boolean | Whether the site is in the trash. After restoring — `false`. In [`GET \u002Fv1\u002Fsites`](\u002Fdocs\u002Fentities\u002Fsites\u002Flist) responses the same field comes as a string `\"Y\"` \u002F `\"N\"` |\n| `data.type` | string | Site type: `PAGE`, `STORE`, `KNOWLEDGE` and other values from [`GET \u002Fv1\u002Fsites\u002Ffields`](\u002Fdocs\u002Fentities\u002Fsites\u002Ffields) |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 233,\n    \"active\": false,\n    \"deleted\": false,\n    \"type\": \"PAGE\"\n  }\n}\n```\n\n## Error response example\n\n404 — site not found:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Site not found or not visible\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|---------|\n| 400 | `INVALID_PARAMS` | `id` is not a positive integer |\n| 400 | `INVALID_SCOPE` | `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 400 | `INVALID_PARAMS` | A request body was passed. The method accepts an empty body or `{}` |\n| 404 | `ENTITY_NOT_FOUND` | No site with this `id` exists, it is not accessible to the key's user, or it belongs to a different `scope` |\n| 404 | `ENTITY_NOT_FOUND` | The site was not found after the operation: it was deleted by a concurrent request |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not confirm the site operation or rejected it. The reason is in `message` |\n| 409 | `LANDING_MODULE_NOT_ENABLED` | The Sites module is unavailable on the Bitrix24 account. Ask the Bitrix24 account administrator to enable it. While the module is disabled, a retry returns the same refusal |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access: the key's user has no permissions on this site or no administrator rights, or the feature is unavailable on the Bitrix24 account |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The API key is read-only |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n\nFull list of common API errors: [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **Restoring does not bring back publication.** The site comes back with `active: false`, even if it was published before it went to the trash or was published while it was in the trash. Publish the site again with [`POST \u002Fv1\u002Fsites\u002F:id\u002Fpublication`](\u002Fdocs\u002Fentities\u002Fsites\u002Fpublication).\n- **Restoring a site that is not in the trash succeeds without an error.** The response is `200`, and the site does not change.\n\n## See also\n\n- [Move a site to trash](\u002Fdocs\u002Fentities\u002Fsites\u002Ftrash)\n- [Site publication](\u002Fdocs\u002Fentities\u002Fsites\u002Fpublication)\n- [List sites](\u002Fdocs\u002Fentities\u002Fsites\u002Flist)\n","2026-10-16",{},1795415302460]