Skip to content

Make an earlier version (version_id) an artifact's content again, as a new version: nothing in between is lost.

POST/workspaces/{workspace}/artifacts/{artifact_id}/versions/{version_id}/restore

Takes the edit role. Returns the new version.

  • Authentication: Required. Send an access token as Authorization: Bearer.
  • MCP tool: artifact with action restore_version, and the same inputs
  • Scope: An access token needs artifacts:write.
Name Type Required Description
workspace string Yes The workspace’s slug, e.g. “acme”.
artifact_id string Yes The artifact’s id (fol_…), or its address: /acme/-/artifacts/q4-roadmap-fol_…
version_id string Yes The version’s id (ver_…), from its versions.
curl -X POST https://api.g1t.sh/workspaces/acme/artifacts/fol_01kq7c4e6g8j0m2p4r6t8v0x2z/versions/ver_01kq7c4e6g8j0m2p4r6t8v0x2y/restore \
-H "Authorization: Bearer $G1T_TOKEN"

A successful request answers 200 with:

{
"id": "ver_01kqb8j0m2p4r6t8v0x2z4b6d",
"artifact_id": "fol_01kq7c4e6g8j0m2p4r6t8v0x2z",
"created_at": "2026-10-09T12:00:00.000Z",
"kind": "restore",
"note": null,
"authors": [
{
"type": "user",
"id": "usr_01kkntcg1eeb98j62xjm7eh09q",
"username": "ana",
"display_name": "Ana Lima"
}
]
}

A failed request answers with one of these statuses and a body like {"error": {"code": "not_found", "message": "Repository not found."}}. See errors.

Status Code When
401 unauthenticated A token is required, or the one sent is not valid.
403 forbidden The token is valid but not allowed to do this, such as a member-only change or an agent token outside its repository.
404 not_found It does not exist, or you cannot see it.
409 conflict The request conflicts with the current state.
422 invalid The input is not valid. message says which field and why.