/Docs
Search docs or ask a question⌘K
DocsAgent
Changelog
API Reference Restore Revision

Restore Revision

Bring back a past revision of a project written in Syntext — every file, or the ones you choose — as a new revision.

POST/v1/projects/{projectId}/content/revisions/{number}/restoreTry it
API key or session token

Bring files back to how they were at revision {number}. The restore is saved as a new revision (source: "restore"), so history is never rewritten and you can undo a restore by restoring again. Like any save, it's a draft until you publish — or send publish: true.

Note

Any workspace member (session JWT), or an API key bound to this project with the full scope.

Path Parameters

NameDescription
projectId:stringpathRequired
The project ID.
number:integerpathRequired
The revision to bring back. See Content History.

Request Body

NameDescription
paths:string[]body
Only these files, 1–500 paths. Omit to restore the whole project: every file goes back to how it was, and files that didn't exist then are deleted. With paths, a listed file that didn't exist then is deleted too.
message:stringbody
The revision message, up to 500 characters. Defaults to Restore <what> to revision N.
publish:booleanbody
Publish the result right away.
Defaultfalse

Response — 200 OK

•
revision is null when the files already match revision {number}; nothing is written.
•
publish is present when you sent publish: true and a revision was written. When the publish couldn't start, build is null and skipped says why — for example { "code": "USAGE_LIMIT_EXCEEDED", "current": 100, "limit": 100 }. The restore is saved either way.

Error Responses

400 Bad Request

validation_error — {number} isn't a positive integer, or the body is invalid.

404 Not Found

not_found — no revision with that number in this project.

409 Conflict

•
save_conflict — a file changed while the restore was being written. Try again.
•
content_source_github / content_source_upload — the project isn't written in Syntext.

413 Payload Too Large

too_many_files or content_too_large — the result would be over the project's 2,000 files or 200 MB.

Was this page helpful? Yes No
Request
bashJavaScriptPythonGoRubyPHPJavaC#bash
curl -X POST https://api.syntext.dev/v1/projects/3f2a9c1e-8b4d-4e7a-9c21-5d6e7f8a9b0c/content/revisions/9/restore \
-H "Authorization: Bearer stx_A1b2C3d4_..." \
-H "Content-Type: application/json" \
-d '{ "paths": ["guides/quickstart.mdx"], "publish": true }'
Responseapplication/json
200OK
{
"data": {
"revision": { "id": "7e3a1b9c-2d4f-4a8e-b6c1-9f0d5e2a7c30", "number": 15 },
"files": [{ "path": "guides/quickstart.mdx", "sha": "3f1c9a7e2b4d6f8a0c1e3b5d7f9a1c3e5b7d9f1a" }],
"publish": { "build": { "id": "b7d2e9a4-1c3f-4b8e-9a6d-2f5c8e1b4a70", "status": "queued" }, "revision": { "id": "7e3a1b9c-2d4f-4a8e-b6c1-9f0d5e2a7c30", "number": 15 } }
}
}
Product
Resources
Company
© 2026 SyntextBuilt with Syntext