Delete Page File
Delete a .md or .mdx page from the project's repository in one commit.
Delete one doc page from the project's branch, in a commit named docs: delete <path>. Pass the sha you last saw and the delete is refused if someone has changed the page since.
Any member of the workspace can delete pages, signed in with a session JWT — API keys are refused with 401. You must belong to the organization that owns {projectId}. Available on every plan.
On a GitHub project, the project needs a GitHub App installation that belongs to its workspace, and the delete is a commit. On a project written in Syntext, it's a draft revision: the site drops the page when you next publish.
Only .md and .mdx files under the docs folder can be deleted. Other file types and the repository-root config files (syntext.json and friends) are refused.
No build is started — the deleted page disappears from the site at the next build, for example after your next save or push. Deleting a file does not edit syntext.json — if the page is listed in your navigation, remove it there too.
Path Parameters
projectIdpathguides%2Fold-page.mdx.Query Parameters
shasha you last saw for the file, from GET /pages/{path}/content or a save. If the file has changed since, the delete is refused with 409 save_conflict. Omit it to delete without a check.Response — 200 OK
The deletion is recorded in the audit log as page.delete.
Error Responses
400 Bad Request
invalid_path — the path is not a .md or .mdx page, is a root config file, is absolute, contains a backslash or control character, or has an empty, . or .. segment. details.path names it.
bad_request — the project has no repository, an invalid repository URL, or no GitHub App installation.
401 Unauthorized
No session JWT, an expired one, or an API key.
403 Forbidden
forbidden — you are not a member of the organization that owns the project.
installation_not_owned — the project's GitHub App installation is not connected to its workspace.
404 Not Found
not_found — the project does not exist or was deleted, or the file does not exist on the branch.
409 Conflict
content_source_upload — the project is published with stx deploy, so its files aren't stored in Syntext.
save_conflict — the file changed since the sha you sent. The details have the same shape as a save conflict, for this one file:
500 Internal Server Error
internal_error — the GitHub integration is temporarily unavailable.
502 Bad Gateway
github_error — GitHub refused the deletion. details.githubStatus is GitHub's HTTP status.