Skip to content

CMS Page — Delete

Deletes a CMS page. Equivalent to DELETE /api/admin/cms/pages/{id}.

Prerequisites

Replace the example id with a CMS page id that exists in your store — use the adminCmsPages query to find one.

Operation

OperationType
deleteAdminCmsPageMutation

Input

FieldTypeRequiredNotes
idID!yesResource IRI — /api/admin/cms/pages/{id}.

What it returns

The mutation returns a snapshot of the deleted page, captured just before removal, so you can confirm what was deleted in the same round trip. The scalar fields all resolve — id, _id, urlKey, pageTitle, htmlContent, metaTitle, metaKeywords, metaDescription, locale. Select the fields you want to log or display.

Confirming success vs. failure

Select the message field to get the human-readable success confirmation ("CMS page deleted successfully."). The contract:

  • Successdata.deleteAdminCmsPage.adminCmsPage is non-null, message carries the confirmation, and errors is absent.
  • Failuredata.deleteAdminCmsPage is null and the reason is in the top-level errors array (page not found, no permission, or a deletion failure). message is only populated on success.

(message is null on read / list / detail queries — it is an action result, meaningful only on the delete mutation.)

translations and channels come back empty

The translations and channels connections are re-read from the database when resolved, but the row (and its translation / channel rows) are already gone at that point — so those connections return empty edges on a delete result. To capture per-locale content before deleting, query the detail first. Scalar fields like urlKey / pageTitle are taken from the in-memory snapshot and do resolve.

Deleting a page also removes any storefront redirects (url rewrites) that pointed at its slugs.

Errors

ConditionResult
Page ID not foundnot-found error
Admin role lacks cms.deletepermission error

Released under the MIT License.