---
title: "Delete a data source"
method: DELETE
path: "/api/public/organizations/{orgId}/data-sources/{id}"
tags: ["Data Sources"]
---

# Delete a data source

`DELETE /api/public/organizations/{orgId}/data-sources/{id}`

## Request

- Base URL: `https://charts.basedash.com`
- URL: `https://charts.basedash.com/api/public/organizations/{orgId}/data-sources/{id}`
- Auth: HTTP bearer

Soft-deletes a data source by ID. Requires admin access to the organization. The data source will be marked as deleted and a cleanup job will be triggered to remove related entities.

## Path parameters

- `orgId` string, required: Organization ID
- `id` string, required: Data source ID

## Response `200`

Data source deleted successfully

- object
  - `data` object, required
    - `id` string, required: Data source ID
    - `displayName` string, required: Display name for the data source
    - `description` string, required: Description of the data source
    - `dialect` union, required: Database dialect/type
      - 'ELASTICSEARCH'
      - 'POSTGRES'
      - 'SUPABASE'
      - 'MYSQL'
      - 'PLANETSCALE'
      - 'ATHENA'
      - 'BIGQUERY'
      - 'CLICKHOUSE'
      - 'SPANNER'
      - 'SNOWFLAKE'
      - 'REDSHIFT'
      - 'SQL_SERVER'
      - 'ORACLE'
      - 'DATABRICKS'
      - 'POSTHOG'
      - 'DUCKDB'
      - 'MOTHERDUCK'
    - `databaseName` string, nullable, required: Database name
    - `username` string, nullable, required: Database username
    - `host` string, nullable, required: Database host
    - `port` number, nullable, required: Database port
    - `sslEnabled` boolean, nullable, required: Whether SSL is enabled
    - `sslCustomCertificatesEnabled` boolean, nullable, required: Whether custom SSL certificates are enabled
    - `sslVerifyServerCertificate` boolean, nullable, required: Whether the server's TLS certificate is verified when SSL is on. Null for data sources created before this setting, which don't verify
    - `sshEnabled` boolean, nullable, required: Whether SSH tunnel is enabled
    - `sshHost` string, nullable, required: SSH tunnel host
    - `sshPort` number, nullable, required: SSH tunnel port
    - `sshUsername` string, nullable, required: SSH tunnel username
    - `bigQueryProjectId` string, nullable, required: BigQuery project ID
    - `spannerInstanceId` string, nullable, required: Spanner instance ID
    - `athenaWorkgroup` string, nullable, required: Athena workgroup
    - `athenaOutputLocation` string, nullable, required: Athena output location
    - `athenaCatalog` string, nullable, required: Athena data catalog
    - `snowflakeAccountId` string, nullable, required: Snowflake account ID
    - `snowflakeWarehouse` string, nullable, required: Snowflake warehouse
    - `snowflakeRole` string, nullable, required: Snowflake role
    - `lastSuccessfulSyncAt` string, date-time, nullable, required: Last successful schema sync timestamp
    - `lastSyncStatus` union, required: Status of the last schema sync
      - 'PENDING'
      - 'SUCCESS'
      - 'FAILED'
      - 'NEVER_SYNCED'
    - `lastSyncAttemptAt` string, date-time, nullable, required: Last schema sync attempt timestamp
    - `hasCompletedFirstSync` boolean, required: Whether the first schema sync has completed
    - `syncErrorMessage` string, nullable, required: Error message from the last failed sync
    - `lastHealthyAt` string, date-time, required: Last time the connection was healthy
    - `lastHealthStatus` union, required: Connection health status
      - 'HEALTHY'
      - 'UNHEALTHY'
    - `lastHealthCheckAttemptAt` string, date-time, required: Last health check attempt timestamp
    - `isDemo` boolean, required: Whether this is a demo data source
    - `isBasedashWarehouse` boolean, required: Whether this is a Basedash-managed warehouse
    - `createdAt` string, date-time, required: Creation timestamp
    - `updatedAt` string, date-time, required: Last update timestamp

## Other responses

- `401`: Unauthorized - Missing or invalid API key
- `404`: Not found - Data source not found or no admin access
- `429`: Rate limit exceeded - Too many requests
- `500`: Internal server error

---

[API](https://skmtc.dev/basedash/apis/basedash-public-api.md) - [All operations](https://skmtc.dev/basedash/apis/basedash-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/basedash/apis/basedash-public-api/revisions/efb9d40bc6f7?raw)
