API referenceProjects

Restore a repository tree as a new project

The inverse of GET /projects/{id}/repo-tree: the files of a repository become a NEW project.

The tree is validated as a whole first (allowlisted paths, at most 2000 files and 40 MB, schemas, every scene, block text file and $asset reference resolving); any problem answers 400 invalid_tree with every error and writes nothing. dry_run returns the plan and the report without writing. Otherwise a project is created and these steps run through the existing writers, in this order: tempo, theme, voice, captions, branding, runtime, chapters, block text, block pauses. Every id is minted by the server; applied.id_map maps the repo ids to the new ones. Not restored in this version (listed in deferred, with the reason): scenes, compositions, structured scene source, seams, cues, music, score, bible, groove and mix. dropped lists what has no writer or depends on generated audio (a block's voice take is reported voice_not_restored: regenerate). A step that fails leaves status: partial with the project in place; nothing is rolled back. Never charges credits and never generates media. The request body is bounded by the platform (about 4.5 MB on serverless) before the parser's own caps.

POST
/projects/restore-tree

Authorization

bearerAuth
AuthorizationBearer <token>

Typecut API key. Generate one in app.typecut.ai → Settings → API keys. Send as Authorization: Bearer tc_live_….

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/projects/restore-tree" \  -H "Content-Type: application/json" \  -d '{    "files": {      "property1": "string",      "property2": "string"    }  }'
{
  "data": {
    "dry_run": true,
    "status": "planned",
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "editor_url": "string",
    "plan": {
      "project": {
        "name": "string",
        "aspectRatio": "string",
        "chapters": 0,
        "blocks": 0,
        "scenes": 0
      },
      "steps": [
        {
          "id": "string",
          "kind": "string",
          "after": [
            "string"
          ]
        }
      ],
      "idRemaps": [
        {
          "kind": "chapter",
          "origin": "string",
          "step": "string"
        }
      ]
    },
    "applied": {
      "steps": [
        "string"
      ],
      "counts": {
        "chapters": 0,
        "blocks": 0,
        "block_pauses": 0,
        "settings": [
          "string"
        ]
      },
      "id_map": {
        "chapters": {
          "property1": "string",
          "property2": "string"
        },
        "blocks": {
          "property1": "string",
          "property2": "string"
        }
      }
    },
    "not_applied": [
      "string"
    ],
    "deferred": [
      {
        "what": "string",
        "reason": "string",
        "count": 0,
        "until": "2b"
      }
    ],
    "dropped": [
      {
        "what": "string",
        "reason": "string",
        "count": 0,
        "until": "2b"
      }
    ],
    "errors": [
      {
        "step": "string",
        "message": "string"
      }
    ],
    "warnings": [
      "string"
    ]
  }
}
{
  "data": {
    "dry_run": true,
    "status": "planned",
    "project_id": "405d8375-3514-403b-8c43-83ae74cfe0e9",
    "editor_url": "string",
    "plan": {
      "project": {
        "name": "string",
        "aspectRatio": "string",
        "chapters": 0,
        "blocks": 0,
        "scenes": 0
      },
      "steps": [
        {
          "id": "string",
          "kind": "string",
          "after": [
            "string"
          ]
        }
      ],
      "idRemaps": [
        {
          "kind": "chapter",
          "origin": "string",
          "step": "string"
        }
      ]
    },
    "applied": {
      "steps": [
        "string"
      ],
      "counts": {
        "chapters": 0,
        "blocks": 0,
        "block_pauses": 0,
        "settings": [
          "string"
        ]
      },
      "id_map": {
        "chapters": {
          "property1": "string",
          "property2": "string"
        },
        "blocks": {
          "property1": "string",
          "property2": "string"
        }
      }
    },
    "not_applied": [
      "string"
    ],
    "deferred": [
      {
        "what": "string",
        "reason": "string",
        "count": 0,
        "until": "2b"
      }
    ],
    "dropped": [
      {
        "what": "string",
        "reason": "string",
        "count": 0,
        "until": "2b"
      }
    ],
    "errors": [
      {
        "step": "string",
        "message": "string"
      }
    ],
    "warnings": [
      "string"
    ]
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}
{
  "error": {
    "type": "string",
    "code": "string",
    "message": "string"
  }
}