> ## Documentation Index
> Fetch the complete documentation index at: https://basedash.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete a data source

> 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.



## OpenAPI

````yaml https://charts.basedash.com/api/public/openapi delete /api/public/organizations/{orgId}/data-sources/{id}
openapi: 3.1.0
info:
  title: Basedash Public API
  version: 0.0.0
  description: >-
    API for programmatic access to Basedash features. Use API keys for
    authentication.
  contact:
    name: Basedash Support
    url: https://basedash.com
    email: support@basedash.com
servers:
  - url: https://charts.basedash.com
    description: Production
security: []
tags:
  - name: Organizations
    description: Manage organizations
  - name: Groups
    description: Manage organization groups and memberships
  - name: Data Sources
    description: Manage database connections and data sources
  - name: MCP servers
    description: Manage MCP server data sources
  - name: Insights
    description: Manage generated insights
  - name: Automations
    description: Manage automations and automation runs
  - name: Skills
    description: Manage organization skills
  - name: Definitions
    description: Manage reusable SQL definitions
paths:
  /api/public/organizations/{orgId}/data-sources/{id}:
    delete:
      tags:
        - Data Sources
      summary: Delete a data source
      description: >-
        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.
      parameters:
        - schema:
            type: string
            description: Organization ID
          required: true
          description: Organization ID
          name: orgId
          in: path
        - schema:
            type: string
            description: Data source ID
          required: true
          description: Data source ID
          name: id
          in: path
      responses:
        '200':
          description: Data source deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                        description: Data source ID
                      displayName:
                        type: string
                        description: Display name for the data source
                      description:
                        type: string
                        description: Description of the data source
                      dialect:
                        $ref: '#/components/schemas/DatabaseDialect'
                      databaseName:
                        type:
                          - string
                          - 'null'
                        description: Database name
                      username:
                        type:
                          - string
                          - 'null'
                        description: Database username
                      host:
                        type:
                          - string
                          - 'null'
                        description: Database host
                      port:
                        type:
                          - number
                          - 'null'
                        description: Database port
                      sslEnabled:
                        type:
                          - boolean
                          - 'null'
                        description: Whether SSL is enabled
                      sslCustomCertificatesEnabled:
                        type:
                          - boolean
                          - 'null'
                        description: Whether custom SSL certificates are enabled
                      sshEnabled:
                        type:
                          - boolean
                          - 'null'
                        description: Whether SSH tunnel is enabled
                      sshHost:
                        type:
                          - string
                          - 'null'
                        description: SSH tunnel host
                      sshPort:
                        type:
                          - number
                          - 'null'
                        description: SSH tunnel port
                      sshUsername:
                        type:
                          - string
                          - 'null'
                        description: SSH tunnel username
                      bigQueryProjectId:
                        type:
                          - string
                          - 'null'
                        description: BigQuery project ID
                      spannerInstanceId:
                        type:
                          - string
                          - 'null'
                        description: Spanner instance ID
                      athenaWorkgroup:
                        type:
                          - string
                          - 'null'
                        description: Athena workgroup
                      athenaOutputLocation:
                        type:
                          - string
                          - 'null'
                        description: Athena output location
                      athenaCatalog:
                        type:
                          - string
                          - 'null'
                        description: Athena data catalog
                      snowflakeAccountId:
                        type:
                          - string
                          - 'null'
                        description: Snowflake account ID
                      snowflakeWarehouse:
                        type:
                          - string
                          - 'null'
                        description: Snowflake warehouse
                      snowflakeRole:
                        type:
                          - string
                          - 'null'
                        description: Snowflake role
                      lastSuccessfulSyncAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                        description: Last successful schema sync timestamp
                      lastSyncStatus:
                        $ref: '#/components/schemas/SyncStatus'
                      lastSyncAttemptAt:
                        type:
                          - string
                          - 'null'
                        format: date-time
                        description: Last schema sync attempt timestamp
                      hasCompletedFirstSync:
                        type: boolean
                        description: Whether the first schema sync has completed
                      syncErrorMessage:
                        type:
                          - string
                          - 'null'
                        description: Error message from the last failed sync
                      lastHealthyAt:
                        type: string
                        format: date-time
                        description: Last time the connection was healthy
                      lastHealthStatus:
                        $ref: '#/components/schemas/ConnectionHealthStatus'
                      lastHealthCheckAttemptAt:
                        type: string
                        format: date-time
                        description: Last health check attempt timestamp
                      isDemo:
                        type: boolean
                        description: Whether this is a demo data source
                      isBasedashWarehouse:
                        type: boolean
                        description: Whether this is a Basedash-managed warehouse
                      mutatingQueriesEnabled:
                        type: boolean
                        description: Whether admins can approve AI-generated database edits
                      createdAt:
                        type: string
                        format: date-time
                        description: Creation timestamp
                      updatedAt:
                        type: string
                        format: date-time
                        description: Last update timestamp
                    required:
                      - id
                      - displayName
                      - description
                      - dialect
                      - databaseName
                      - username
                      - host
                      - port
                      - sslEnabled
                      - sslCustomCertificatesEnabled
                      - sshEnabled
                      - sshHost
                      - sshPort
                      - sshUsername
                      - bigQueryProjectId
                      - spannerInstanceId
                      - athenaWorkgroup
                      - athenaOutputLocation
                      - athenaCatalog
                      - snowflakeAccountId
                      - snowflakeWarehouse
                      - snowflakeRole
                      - lastSuccessfulSyncAt
                      - lastSyncStatus
                      - lastSyncAttemptAt
                      - hasCompletedFirstSync
                      - syncErrorMessage
                      - lastHealthyAt
                      - lastHealthStatus
                      - lastHealthCheckAttemptAt
                      - isDemo
                      - isBasedashWarehouse
                      - mutatingQueriesEnabled
                      - createdAt
                      - updatedAt
                required:
                  - data
        '401':
          description: Unauthorized - Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found - Data source not found or no admin access
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded - Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    DatabaseDialect:
      anyOf:
        - type: string
          enum:
            - POSTGRES
        - type: string
          enum:
            - SUPABASE
        - type: string
          enum:
            - MYSQL
        - type: string
          enum:
            - PLANETSCALE
        - type: string
          enum:
            - ATHENA
        - type: string
          enum:
            - BIGQUERY
        - type: string
          enum:
            - CLICKHOUSE
        - type: string
          enum:
            - SPANNER
        - type: string
          enum:
            - SNOWFLAKE
        - type: string
          enum:
            - REDSHIFT
        - type: string
          enum:
            - SQL_SERVER
        - type: string
          enum:
            - ORACLE
        - type: string
          enum:
            - DATABRICKS
        - type: string
          enum:
            - POSTHOG
        - type: string
          enum:
            - DUCKDB
      description: Database dialect/type
    SyncStatus:
      anyOf:
        - type: string
          enum:
            - PENDING
        - type: string
          enum:
            - SUCCESS
        - type: string
          enum:
            - FAILED
        - type: string
          enum:
            - NEVER_SYNCED
      description: Status of the last schema sync
    ConnectionHealthStatus:
      anyOf:
        - type: string
          enum:
            - HEALTHY
        - type: string
          enum:
            - UNHEALTHY
      description: Connection health status
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ApiError'
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/RateLimitError'
      required:
        - error
    ApiError:
      type: object
      properties:
        title:
          type: string
          description: Error type identifier
        detail:
          type: string
          description: Human-readable error description
      required:
        - title
        - detail
    RateLimitError:
      allOf:
        - $ref: '#/components/schemas/ApiError'
        - type: object
          properties:
            title:
              type: string
              enum:
                - RateLimitExceeded
            retryAfterMs:
              type: number
              description: Milliseconds until the rate limit window resets
          required:
            - retryAfterMs
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication using Bearer token format: `Bearer
        <basedash_api_key>`

````