Delete a page

Delete a single page. Pages are identified by slug, content type, and section together. To delete many pages at once, or to delete and create in the same request, use deleteSlugs on the pages batch.

DELETE https://sitepaste.com/api/v1/public/sites/{siteId}/pages/{contentType}/{section}/{slug}

Requires the content scope.

Usage

curl -X DELETE "https://sitepaste.com/api/v1/public/sites/default/pages/blog/old-post" \
  -H "Authorization: Bearer $TOKEN"

Authorizations

HeaderTypeRequiredDescription
AuthorizationstringYesBearer token (Authorization: Bearer sp_...). Created in the dashboard under Account > Tokens. See authentication.

Path parameters

ParameterTypeRequiredDescription
contentTypestringYesblog, docs, standalone, or homepage.
sectionstringIf the page has oneThe page’s section path. Nests one level for docs and blog, two for standalone; omitted for a sectionless page.
slugstringYes, except the homepageThe page’s URL slug. The homepage has neither section nor slug: it is addressed as pages/homepage.

The three segments together are the page’s identity. See Addressing a page.

Addressing a page

A page’s address is its content type, then its section if it has one, then its slug. The address takes no query parameters.

PageURI
A blog post hello/sites/{siteId}/pages/blog/hello
A docs page install in section setup/sites/{siteId}/pages/docs/setup/install
A standalone page about/sites/{siteId}/pages/standalone/about
A standalone page in a nested section/sites/{siteId}/pages/standalone/api/media/get-media
The site’s homepage/sites/{siteId}/pages/homepage

The section is matched exactly: pages/docs/install names the docs page with no section, and the one inside setup is a 404 until you name the section too. The homepage has no section and no slug in its address, because a site has only one.

Response

204 No Content on success.

404 Not Found when no page matches the slug, content type, and section in the site.

409 Conflict with code cannot_delete_homepage for pages/homepage, because a site always keeps its homepage. Replace its content through the batch or PATCH instead.