---
title: "Update a CMS page (locale-nested)"
method: PUT
path: "/cms/pages/{id}"
tags: ["Admin CMS"]
---

# Update a CMS page (locale-nested)

`PUT /cms/pages/{id}`

## Request

- Base URL: `http://localhost:8000/api/admin`
- URL: `http://localhost:8000/api/admin/cms/pages/{id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/bagisto/apis/bagisto-admin-api/docs/cms/pages/:id/put.ts> (a function with typed inputs; its response is checked against the schema)

Mirrors Bagisto admin CMS → Pages → Edit. Validation is LOCALE-NESTED: `<locale>.url_key`, `<locale>.page_title`, `<locale>.html_content` are required. Top-level: `channels` (required), `locale` (required — names which locale block is being updated). url_key uniqueness excludes the current page.

## Path parameters

- `id` integer, required

## Request body

- object
  - `locale` string, required
  - `channels` integer[], required
  - `en` object

## Response `200`

Page updated.

- AdminCmsPageAdminCmsPageDetailDto: Admin CMS → Pages endpoints (CMS Phase 1 read-only + CMS Phase 2 CRUD). Standalone Eloquent model on `cms_pages` following the shop CustomerOrder pattern: REST operations map to output DTOs (AdminCmsPageListDto / AdminCmsPageDetailDto) so the REST payload is byte-identical to the original, while GraphQL operations return this Eloquent model so the `translations` and `channels` relations are field-selectable (e.g. `translations { pageTitle urlKey } channels { id code name }`). Providers gate on GraphQL context to return the model for GraphQL and the DTO for REST. Mirrors Webkul\Admin\Http\Controllers\CMS\PageController 1:1.
  - `id` integer, nullable
  - `urlKey` string, nullable
  - `pageTitle` string, nullable
  - `htmlContent` string, nullable
  - `metaTitle` string, nullable
  - `metaKeywords` string, nullable
  - `metaDescription` string, nullable
  - `layout` string, nullable
  - `previewUrl` string, nullable
  - `locale` string, nullable
  - `channel` string, nullable
  - `createdAt` string, nullable
  - `updatedAt` string, nullable
  - `translations` unknown[], nullable
    - unknown
  - `channels` unknown[], nullable
    - unknown

## Other responses

- `400`: Invalid input
- `404`: Page not found.
- `422`: Validation failure.

---

[API](https://skmtc.dev/bagisto/apis/bagisto-admin-api.md) - [All operations](https://skmtc.dev/bagisto/apis/bagisto-admin-api/llms.txt) - [OpenAPI document](https://skmtc.dev/bagisto/apis/bagisto-admin-api/revisions/3198f11be70f?raw)
