import_model
Import a Bridge Town model from a .btx archive file. First upload the file from the same authenticated user session as multipart field ‘archive’ to the owned endpoint https://api.bridgetown.builders/api/models/imports/stage; pass its staged_import_id response here as archive_source before expires_at. The token is single-use and bound to that user and workspace; on expiry or replay stage the archive again rather than retrying the consumed id.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
archive_source | Annotated[str, Field(description="Opaque staged archive UUID returned after an authenticated multipart POST to https://api.bridgetown.builders/api/models/imports/stage with the .btx file in form field 'archive'. Read 'staged_import_id' and 'expires_at' from the response, then pass the id here from the same user session. The id is single-use and user/workspace-bound. Filesystem paths, URLs, and basenames are not accepted.")] | Yes | — | |
target_workspace_id | `Annotated[str | None, Field(description=‘UUID of the target workspace to import into. Defaults to the current workspace. Cross-workspace targeting requires an active membership with editor role or higher in that workspace and is only available to OAuth/JWT sessions — API tokens stay scoped to their issuing workspace.’)]` | No | None |
options | `Annotated[ImportModelOptions | None, Field(description=‘Optional closed import configuration: conflict_policy, repo_name, and/or an idempotency_key for a retry.’)]` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
job_id(string)status(string)target_workspace_id(string)target_repo_name(string)message(string)duplicate_of(null)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "import_model", "arguments": { "archive_source": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", "target_workspace_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "options": { "repo_name": "forecasts-imported", "conflict_policy": "fail", "idempotency_key": "forecasts-import-20260428" } }}Response
Section titled “Response”{ "job_id": "cccccccc-cccc-cccc-cccc-cccccccccccc", "status": "queued", "target_workspace_id": "dddddddd-dddd-dddd-dddd-dddddddddddd", "target_repo_name": "forecasts-imported", "message": "Import queued.", "duplicate_of": null}- Module:
Imports - Requires an authenticated Bridge Town session (OAuth) or an API token.