detach_data_source
Detach a data source so it stops affecting future model runs (soft-delete; retained for lineage). Referenced snapshots stay retained and listable via list_data_source_snapshots; unreferenced ones become eligible for cleanup. No S3 objects are deleted synchronously by this call. Requires at least Editor role. DESTRUCTIVE — defaults to dry_run=True and returns a confirmation_token.
Parameters
Section titled “Parameters”| Name | Type | Required | Default | Description |
|---|---|---|---|---|
model_name | Annotated[str, Field(description='Name of the Bridge Town model.')] | Yes | — | |
data_source_id | Annotated[str, Field(description='Data source ID, as returned by list_data_sources.')] | Yes | — | |
dry_run | Annotated[bool, Field(description='Preview the detach without mutating anything.')] | No | True | |
confirmation_token | `Annotated[str | None, Field(description=‘Token required to confirm the detach (returned by a dry run).’)]` | No | None |
workspace_id | `Annotated[str | None, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]` | No | None |
Returns
Section titled “Returns”Returns a structured object. Top-level fields:
model_name(string)data_source_id(string)source_name(string)source_type(string)detached(boolean)already_detached(boolean)dry_run(boolean)confirmation_token(string)message(string)workspace_id(string)
See the response example below for the full payload shape.
Example
Section titled “Example”Tool Call
Section titled “Tool Call”{ "name": "detach_data_source", "arguments": { "model_name": "forecasts", "data_source_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78" }}Response
Section titled “Response”{ "model_name": "forecasts", "data_source_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78", "source_name": "budget_inputs", "source_type": "file_upload", "detached": false, "already_detached": false, "dry_run": true, "confirmation_token": "eyJleHAiOjE3ODAwMDAwMDB9.6f2c...", "message": "Dry run: data source 'budget_inputs' would be detached from 'forecasts'. Pass dry_run=False with confirmation_token to execute.", "workspace_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78"}- Module:
Data - Requires authentication via API token or Auth0 JWT.