Docs
BlogHomeStart building

Versions

Browse your project's version history, see what changed, and roll back to an earlier state.


Every completed prompt produces a version — and so does every file write, GitHub pull and import. You can list the version history, read the exact changes a version introduced, and recover a previous version. All three require the api-key header.

#List Versions

GET/api/v1/vcaas/projects/:projectId/versionsFree

Get all project versions with pagination.

Path parameters

ParameterTypeDescription
projectIdstringThe project ID

Query parameters

FieldTypeRequiredDescription
limitnumberNoNumber of versions to return (default: 20)
skipnumberNoNumber of versions to skip (default: 0)

Response fields

FieldTypeDescription
data.versionsarrayArray of version objects
data.versions[]._idstringVersion ID — use this for Recover Version
data.versions[].namestringVersion display name
data.versions[].commitShastring | undefinedGit commit this version points at — use this for Get Version Diff
data.versions[].commitMessagestring | undefinedGit commit message
data.versions[].promptstring | undefinedThe prompt that created this version
data.versions[].gcsUploadedboolean | undefinedWhether the version's snapshot finished uploading to long-term storage
data.versions[].recoveredVersionIdstring | undefinedPresent when this version was produced by recovering another one — the id of the version that was restored
data.versions[].createdAtstringISO 8601 creation date
data.versions[].updatedAtstringISO 8601 last-modified date
data.totalCountnumberTotal versions available
Two different identifiers

_id and commitSha are not interchangeable. Recovery takes the _id; the diff takes the commitSha. Both come from this response, and there is no lookup from one to the other.

Example request

bash
curl -H "api-key: tlm_sk_your_key" \
  "https://api-accounts.totalum.app/api/v1/vcaas/projects/my-app/versions?limit=20&skip=0"
Success · 200 OK
json
{
  "errors": null,
  "data": {
    "versions": [
      {
        "_id": "v_abc123",
        "name": "Version 3",
        "commitSha": "9f2c1ab",
        "commitMessage": "Added contact form",
        "prompt": "Add a contact form to the landing page",
        "gcsUploaded": true,
        "createdAt": "2026-03-11T10:45:00.000Z",
        "updatedAt": "2026-03-11T10:45:00.000Z"
      }
    ],
    "totalCount": 3
  }
}
Error · 404
json
{
  "errors": {
    "errorCode": "PROJECT_NOT_FOUND",
    "errorMessage": "Project does not exist or you don't own it"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
MISSING_PROJECT_ID400projectId is required
PROJECT_NOT_FOUND404Project does not exist or you don't own it

#Get Version Diff

GET/api/v1/vcaas/projects/:projectId/version-diffFree

The unified diff a single version introduced, as raw text — the same format git diff produces.

The sha is a query parameter, not a path segment

Every other version route is addressed by the version's _id, but a diff can only be produced from its commitSha and there is no lookup between the two. Rather than put two different identifiers in the same position on sibling routes, the path says what it takes: ?commitSha=….

The project must be awake

The diff is computed on the project's sandbox, so a sleeping project answers NO_ACTIVE_SANDBOX. That is a real state rather than a transient failure — prompt the user to start the project (or call Start or Restart Server) instead of retrying.

Path parameters

ParameterTypeDescription
projectIdstringThe project ID

Query parameters

FieldTypeRequiredDescription
commitShastringYesThe commitSha of the version, from List Versions. 7 to 40 hexadecimal characters

Response fields

FieldTypeDescription
data.commitShastringThe commit the diff was produced from
data.diffstringRaw unified diff text. Empty string when the commit changed nothing tracked
Works for versions the agent did not create

Until this endpoint existed, the only viewable changes were the gitDiffUrl on an agent conversation message, so versions produced by a manual file write, a GitHub pull or an import had no visible history at all. This covers all of them.

Example request

bash
curl -H "api-key: tlm_sk_your_key" \
  "https://api-accounts.totalum.app/api/v1/vcaas/projects/my-app/version-diff?commitSha=9f2c1ab"
Success · 200 OK
json
{
  "errors": null,
  "data": {
    "commitSha": "9f2c1ab",
    "diff": "diff --git a/src/app/page.tsx b/src/app/page.tsx\n--- a/src/app/page.tsx\n+++ b/src/app/page.tsx\n@@ -12,6 +12,9 @@\n   return (\n     <main>\n+      <ContactForm />\n     </main>\n   );\n"
  }
}
Error · 400
json
{
  "errors": {
    "errorCode": "INVALID_COMMIT_SHA",
    "errorMessage": "commitSha must be 7 to 40 hexadecimal characters"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
MISSING_PROJECT_ID400projectId is required
PROJECT_NOT_FOUND404Project does not exist or you don't own it
MISSING_COMMIT_SHA400The commitSha query parameter is required
INVALID_COMMIT_SHA400commitSha must be 7 to 40 hexadecimal characters
NO_ACTIVE_SANDBOX400The project's sandbox is not running — start the project and try again

#Recover Version

POST/api/v1/vcaas/projects/:projectId/versions/:id/recoverUses credits

Restore a previous version of the project. This endpoint is asynchronous: it returns immediately and the recovery continues in the background for 1 to 4 minutes.

Asynchronous

Poll GET /projects/:projectId every 10–15 seconds and watch the versionRecovery field. While the recovery is running, versionRecovery.status is "recovering". Recovery is complete the moment versionRecovery becomes null. If versionRecovery.status is "error", surface versionRecovery.errorMessage to the user. Do NOT poll agentProcessStatus for recovery — the agent is not involved in a version recovery.

Note

If the server is not active, it auto-starts (charges START_SERVER credits extra) and returns SERVER_NOT_READY.

Path parameters

ParameterTypeDescription
projectIdstringThe project ID
idstringThe version ID to recover (from GET /versions)

Response fields

FieldTypeDescription
data.messagestringConfirmation message

Example request

bash
curl -X POST -H "api-key: tlm_sk_your_key" \
  https://api-accounts.totalum.app/api/v1/vcaas/projects/my-app/versions/v_abc123/recover
Success · 200 OK
json
{ "errors": null, "data": { "message": "Version recovery initiated" } }
Error · 402
json
{
  "errors": {
    "errorCode": "INSUFFICIENT_CREDITS",
    "errorMessage": "Not enough credits for version recovery"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
MISSING_PROJECT_ID400projectId is required
PROJECT_NOT_FOUND404Project does not exist or you don't own it
MISSING_VERSION_ID400versionId is required
AGENT_RUNNING409Cannot recover while agent is running
DEPLOYMENT_RUNNING409Cannot recover while deployment is in progress
RECOVERY_RUNNING409A version recovery is already in progress
SERVER_NOT_READY409Server auto-starting, poll until Active then retry
INSUFFICIENT_CREDITS402Not enough credits for version recovery
End of Recover Version Back to top