/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Delete Page File

Delete Page File

Delete a .md or .mdx page from the project's repository in one commit.

DELETE/v1/projects/{projectId}/editor/files/{path}Try it
Session token

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.

Note

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

NameDescription
projectId:stringpathRequired
The project ID.
path:stringpathRequired
The page path relative to the docs folder, URL-encoded as one segment — e.g. guides%2Fold-page.mdx.

Query Parameters

NameDescription
sha:stringquery
The blob sha 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:

json
{
"error": {
"code": "save_conflict",
"message": "guides/old-page.mdx was changed since you opened it. Reload before deleting it.",
"details": {
"paths": ["guides/old-page.mdx"],
"files": [
{
"path": "guides/old-page.mdx",
"currentSha": "5e7a9c1b3d5f7e9a1c3b5d7f9e1a3c5b7d9f1e3a",
"lastCommit": { "author": "Ada Lovelace", "at": "2026-11-08T15:52:10Z" }
}
],
"traceId": "6f1c2a9e-3b7d-4c11-9a0e-2d5f8b4c7e10"
}
}
}

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.

Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl -X DELETE "https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/editor/files/guides%2Fold-page.mdx?sha=3f1c9a7e2b4d6f8a0c1e3b5d7f9a1c3e5b7d9f1a" \
-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..."
Responseapplication/json
200OK
{
"data": {
"path": "guides/old-page.mdx",
"deleted": true,
"commitSha": "4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b6d8f0a2c"
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext