Skip to content

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.

NameTypeRequiredDefaultDescription
model_nameAnnotated[str, Field(description='Name of the Bridge Town model.')]Yes
data_source_idAnnotated[str, Field(description='Data source ID, as returned by list_data_sources.')]Yes
dry_runAnnotated[bool, Field(description='Preview the detach without mutating anything.')]NoTrue
confirmation_token`Annotated[strNone, Field(description=‘Token required to confirm the detach (returned by a dry run).’)]`NoNone
workspace_id`Annotated[strNone, Field(description=WORKSPACE_ID_FIELD_DESCRIPTION)]`NoNone

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.

{
"name": "detach_data_source",
"arguments": {
"model_name": "forecasts",
"data_source_id": "6e00ea4c-239d-4ac8-a3eb-ceedca558c78"
}
}
{
"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.