/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog

Content

Where a project's pages live, whether the live site is behind the latest save, and the files of a project written in Syntext.

GET/v1/projects/{projectId}/contentTry it
API key or session token

A project's pages live in one of three places, its contentSource:

contentSourcePages live inSaved withPublished by
hostedSyntext — written in SyntextThe editor or Save Pages, as draft revisionsPublish Content
githubThe connected GitHub repositoryCommitsA push, or a save in the editor
uploadNowhere — the CLI uploads the built site—stx deploy

The content endpoints read and change projects written in Syntext. Pages are read and saved with the Pages & Content API, as on any project. To move a project between Syntext and GitHub, see Connect GitHub.

EndpointScopeDescription
GET /contentreadWhere the pages live, and unpublished changes
GET /content/filesreadEvery file, images included
GET /content/historyreadThe revision list
GET /content/revisions/{number}readOne revision and what it changed
POST /content/revisions/{number}/restorefullBring back a revision, or some of its files
POST /content/publishbuildPublish the project as it is now
POST /content/importfullUpload a .zip or a folder of files
GET /projects/templates—The starter templates
Note

Any workspace member (session JWT), or an API key bound to this project with the scope in the table or higher — see Scopes. Available on every plan.

Get content status

Works on every project. For a project written in Syntext, it also says whether the live site is behind the latest save — the dashboard's N changes not published badge.

json
{
"data": {
"contentSource": "hosted",
"latestRevision": 14,
"publishedRevision": 11,
"unpublishedChanges": true
}
}
•
latestRevision — the newest revision number, or null before the first save.
•
publishedRevision — the newest revision a successful publish deployed. A failed, cancelled or still-running publish doesn't count, so unpublishedChanges stays true until the site really shows the latest save.
•
On a GitHub or CLI project, all three are null / false.

List files

GET/v1/projects/{projectId}/content/files

Every file of a project written in Syntext, sorted by path — pages, config and images:

json
{
"data": [
{ "path": "images/logo.png", "sha": "1f0e3a…", "kind": "asset", "size": 18234 },
{ "path": "index.mdx", "sha": "9b2c4d…", "kind": "text", "size": 1204 },
{ "path": "syntext.json", "sha": "4a7e1c…", "kind": "text", "size": 512 }
]
}

kind is text (a page, syntext.json or another .json / .yaml file) or asset (an image). Images are served from their path: images/logo.png is /images/logo.png on the site.

Paths in a project written in Syntext

•
Pages live at the top level: index.mdx, guides/quickstart.mdx. docs/ can't hold pages directly, and public/ is reserved — keep images at the path they're served from.
•
A project holds .md, .mdx, .json and .yaml files and PNG, JPEG, GIF, SVG and WebP images. Anything else returns 400 unsupported_file_type.
•
File and folder names can't start with a dot or contain control or invisible formatting characters (400 invalid_path).

Limits

LimitValueError
Files per project2,000413 too_many_files
Total size per project200 MB413 content_too_large
One text file1 MB413 file_too_large
One image5 MBSkipped on import

Errors on GitHub and CLI projects

Every content endpoint except GET /content answers 409 on a project that isn't written in Syntext, with details.contentSource:

•
content_source_github — the project is written in its GitHub repository. Its history and publishing follow the repository.
•
content_source_upload — the project is published with stx deploy. Import its files to write it in Syntext.
json
{
"error": {
"code": "content_source_github",
"message": "This project is written in its GitHub repository: its history and publishing follow the repository.",
"details": { "contentSource": "github" }
}
}
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request GET \
--url 'https://api.syntext.dev/v1/projects/{projectId}/content' \
--header 'Authorization: Bearer <token>'
Product
Resources
Company
© 2026 SyntextBuilt with Syntext