[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-entities\u002Fpages\u002Frestore":3,"docs-tabs-entities\u002Fpages\u002Frestore":6},{"content":4,"lastmod":5},"## Restore a page\n\n`POST \u002Fv1\u002Fpages\u002F:id\u002Frestore`\n\nRestores a page from the trash. The page stays unpublished.\n\nRequires the `landing` scope.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|:-----:|----------|\n| `id` (path) | number | yes | Page ID. List: [`GET \u002Fv1\u002Fpages`](\u002Fdocs\u002Fentities\u002Fpages\u002Flist) |\n| `scope` (query) | string | no | Site type: `KNOWLEDGE` — knowledge base, `GROUP` — workgroup site, `MAINPAGE` — main page. Omit the parameter for pages of all other sites |\n\nThe body is empty or `{}`.\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2427\u002Frestore\" \\\n  -H \"X-Api-Key: YOUR_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST \"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2427\u002Frestore\" \\\n  -H \"X-Api-Key: YOUR_APP_KEY\" \\\n  -H \"Authorization: Bearer USER_SESSION_TOKEN\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2427\u002Frestore\", {\n  method: \"POST\",\n  headers: {\"X-Api-Key\": \"YOUR_API_KEY\", \"Content-Type\": \"application\u002Fjson\"},\n  body: JSON.stringify({}),\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst response = await fetch(\"https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fpages\u002F2427\u002Frestore\", {\n  method: \"POST\",\n  headers: {\"X-Api-Key\": \"YOUR_APP_KEY\", \"Authorization\": \"Bearer USER_SESSION_TOKEN\", \"Content-Type\": \"application\u002Fjson\"},\n  body: JSON.stringify({}),\n})\nconst result = await response.json()\nif (!response.ok) throw new Error(result.error.message)\nconsole.log(result.data)\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | Always `true` on success |\n| `data` | object | The page after the action |\n| `data.id` | number | Page ID |\n| `data.siteId` | number | ID of the page's site |\n| `data.folderId` | number \\| null | Folder ID. `null` — the page is at the site root |\n| `data.title` | string | Page title |\n| `data.code` | string | Page code in the URL |\n| `data.active` | boolean | Whether the page is published |\n| `data.deleted` | string | `Y` — the page is in the trash, `N` — it is not |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"id\": 2427,\n    \"siteId\": 3,\n    \"folderId\": null,\n    \"title\": \"Empty page\",\n    \"code\": \"empty-page\",\n    \"active\": false,\n    \"deleted\": \"N\"\n  }\n}\n```\n\n## Error response example\n\n404 — no page with this `id` exists:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"ENTITY_NOT_FOUND\",\n    \"message\": \"Page not found.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 404 | `ENTITY_NOT_FOUND` | `Page not found.` — no page with this `id` exists |\n| 404 | `ENTITY_NOT_FOUND` | `Page or folder not found.` — Bitrix24 did not find the page or folder while performing the action |\n| 400 | `INVALID_PAGE_ID` | `id must be a positive safe integer.` — `id` is not a positive integer |\n| 400 | `INVALID_PARAMS` | `Body must be a JSON object.` — the body is not a JSON object |\n| 400 | `INVALID_PARAMS` | `Body contains a field this operation does not accept.` — the body contains a field, but it must be empty or `{}` |\n| 400 | `INVALID_SCOPE` | `scope must be KNOWLEDGE, GROUP or MAINPAGE, or omitted.` — `scope` is not `KNOWLEDGE`, `GROUP` or `MAINPAGE` |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not confirm the page action.` — Bitrix24 did not confirm the action |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not return the page after the action.` — the page could not be read after the action |\n| 422 | `BITRIX_NO_EFFECT` | `Bitrix24 did not persist the requested page state.` — after the action the page is still in the trash |\n| 422 | `BITRIX_ERROR` | Bitrix24 rejected the action. The error text comes from Bitrix24 |\n| 403 | `SCOPE_DENIED` | The API key does not have the `landing` scope |\n| 403 | `BITRIX_ACCESS_DENIED` | The Bitrix24 user on whose behalf the key was issued has no permission for the page action |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key works in read-only mode; the request is rejected before it reaches Bitrix24 |\n| 401 | `TOKEN_MISSING` | The API key has no configured tokens |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key in `X-Api-Key` is not found or has been revoked |\n| 409 | `PORTAL_ADDRESS_CHANGED` | The on-premise Bitrix24 moved to a new address, but the key's webhook was issued for the old one. Reissue the key's webhook |\n| 429 | `RATE_LIMITED` | The Bitrix24 request limit is exceeded. Retry the request in 1-2 seconds |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 did not respond or responded with a server error |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |\n\nFull list of general API errors — [Errors](\u002Fdocs\u002Ferrors).\n\n## Known specifics\n\n- **A repeated call returns no error.** For a page that is no longer in the trash, the response is `200` with its current state.\n\n## See also\n\n- [Move to trash](\u002Fdocs\u002Fentities\u002Fpages\u002Ftrash)\n- [Get a page](\u002Fdocs\u002Fentities\u002Fpages\u002Fget)\n- [Pages](\u002Fdocs\u002Fentities\u002Fpages)\n","2026-10-21",{},1795415274242]