Docs
BlogHomeStart building

Project Transfer

Export a project and import it into another, on the same or a different account.


Project transfer lets you clone a project — its database and source code — into another project, on the same or a different account. Export returns a secret importCode; whoever holds it can import the project. This is not part of the normal build workflow.

Clone sequence
  1. POST /projects/{sourceProjectId}/export → save data.importCode.
  2. POST /projects → create a NEW empty target project.
  3. POST /projects/{targetProjectId}/import with { "importCode": "<the code>" }.
  4. Poll GET /projects/{targetProjectId} every 10-15s until agentServerStatus: "Active" — the target is now a clone of the source.

#Export Project

POST/api/v1/vcaas/projects/:projectId/exportUses credits

Export this project's database (excluding secrets/sandbox/auth/users/tokens/org) plus a reference to its source code, and get a secret import code. Rate limit: 1 per minute, 5 per hour.

Path parameters

ParameterTypeDescription
:projectIdstringThe project ID to export

Body parameters

FieldTypeRequiredDescription
includeRecordsbooleanNoDefault false. true also exports table data records; false exports only schema/pages/config

Response fields

FieldTypeDescription
data.importCodestringSecret code to import this project. SECRET — anyone with it can import the data + source
data.includeRecordsbooleanWhether data records were included
data.messagestringHuman-readable confirmation

Example request

bash
curl -X POST \
  -H "api-key: tlm_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"includeRecords":false}' \
  https://api-accounts.totalum.app/api/v1/vcaas/projects/my-app/export
Success · 200 OK
json
{
  "errors": null,
  "data": {
    "importCode": "my-app-export-project-8f3b1c9a47e2d650b9114af0c7e3a2d1.zip",
    "includeRecords": false,
    "message": "Export ready. Save the importCode and keep it secret..."
  }
}
Error · 402
json
{
  "errors": {
    "errorCode": "INSUFFICIENT_CREDITS",
    "errorMessage": "Not enough credits"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
PROJECT_EXPORT_LIMIT_REACHED400Rate limit reached (1/min, 5/hour)
INSUFFICIENT_CREDITS402Not enough credits
PROJECT_NOT_FOUND404Project not found or not owned by you

#Import Project

POST/api/v1/vcaas/projects/:projectId/importUses credits

Import a project from an importCode into THIS (almost empty) project: restores the database, sets up the source code, then builds and runs it. Returns immediately; the restore + rebuild run in the background (a few minutes). Existing data is always dropped before restoring. Rate limit: 1 per minute, 5 per hour.

Preconditions

The target project must be (almost) empty — at most 5 database tables and at most 1 version. While importing, prompting the agent returns IMPORT_IN_PROGRESS. After calling import, poll GET /projects/{projectId} every 10-15s until agentServerStatus is "Active" and a preview URL is present.

Path parameters

ParameterTypeDescription
:projectIdstringThe target project ID to import into

Body parameters

FieldTypeRequiredDescription
importCodestringYesThe importCode returned by the export endpoint (any project)

Response fields

FieldTypeDescription
data.projectIdstringThe target project ID
data.statusstringAlways "importing"
data.messagestringInstructions to poll for completion

Example request

bash
curl -X POST \
  -H "api-key: tlm_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{"importCode":"my-app-export-project-8f3b1c9a....zip"}' \
  https://api-accounts.totalum.app/api/v1/vcaas/projects/my-new-app/import
Success · 200 OK
json
{
  "errors": null,
  "data": {
    "projectId": "my-new-app",
    "status": "importing",
    "message": "Project import started. Poll GET /projects/:projectId until agentServerStatus='Active'."
  }
}
Error · 400
json
{
  "errors": {
    "errorCode": "PROJECT_NOT_IMPORTABLE",
    "errorMessage": "Target already has content (>5 tables or >1 version). Use a fresh project"
  },
  "data": null
}

Error codes

CodeHTTPMeaning
MISSING_IMPORT_CODE400importCode is required
PROJECT_NOT_IMPORTABLE400Target already has content (>5 tables or >1 version). Use a fresh project
IMPORT_IN_PROGRESS400An import is already running for this project
AGENT_RUNNING409Wait for the agent to finish before importing
PROJECT_IMPORT_LIMIT_REACHED400Rate limit reached (1/min, 5/hour)
INSUFFICIENT_CREDITS402Not enough credits