Mode Data Sources API

The Data Sources API from Mode — 6 operation(s) for data sources.

Operations 7

GET /{account}/data_sources/{data_source}/datasets List Datasets using a data source #
POST /{account}/data_sources/{data_source}/schema_updates Update data source schema #
GET /{workspace}/data_sources List data sources #
GET /{workspace}/data_sources/{data_source} Get a data source #
PATCH /{workspace}/data_sources/{data_source} Update a data source #
POST /{workspace}/data_sources/{data_source}/purge Purge report results #
GET /{account}/data_sources/{data_source}/reports List reports using a data source #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/mode-data-sources-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

mode-data-sources-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 0.0.1
  title: Mode Account Data Sources API
  description: 'Mode provides a REST API for many common operations, such as:


    * Listing spaces and reports

    * Running reports

    * Downloading query results


    ## Authentication


    For most Mode API calls, the client must supply an API token and secret for

    HTTP basic authentication.


    If authentication is required for a given resource, unauthenticated requests

    will result in a `401 Unauthorized` response.


    [Create and Manage API Tokens](https://modeanalytics.com/settings/access_tokens)

    '
  termsOfService: https://mode.com/tos/
  contact:
    name: Mode API Team
    email: support@modeanalytics.com
  license:
    name: MIT
servers:
- url: https://modeanalytics.com/api
security:
- accessTokenAuth: []
tags:
- name: Data Sources
paths:
  /{account}/data_sources/{data_source}/datasets:
    x-summary: Datasets
    get:
      operationId: listDatasetsUsingDataSource
      summary: List Datasets using a data source
      description: Returns all `Dataset`s using a `DataSource`
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: '`Dataset` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '200':
          description: '`Dataset` collection response'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Datasets'
      parameters:
      - name: account
        in: path
        description: '`Account` (`Workspace` or `User`) username'
        required: true
        schema:
          type: string
      - name: data_source
        in: path
        description: '`DataSource` token'
        required: true
        schema:
          type: string
      - name: filter
        in: query
        description: 'Returns a filtered list of `Dataset`s in a `Space` filtered by whether their `created_at` or `updated_at` timestamps are `gt` (greater than) or `lt` (less than) the datetime passed in ISO8601 format. Example: `?filter=created_at.gt.2019-10-23T06:23:01Z` returns all `Datasets` in a space created after that date.'
        required: false
        schema:
          type: string
      - name: order
        in: query
        description: 'With the `order` param, returns all `Dataset`s in a `Space` ordered in `asc` or `desc` order. Example: `?order=asc&order_by=created_at`'
        required: false
        schema:
          type: string
      - name: order_by
        in: query
        description: 'With the `order_by` param, returns all `Dataset`s in a `Space` ordered by their `created_at` or `updated_at` timestamps. Example: `?order_by=created_at&order=asc`'
        required: false
        schema:
          type: string
      tags:
      - Data Sources
  /{account}/data_sources/{data_source}/schema_updates:
    x-summary: DataSources
    post:
      operationId: createDataSourceSchemaUpdate
      summary: Update data source schema
      description: Creates and queues a `schema update` for a `data source`
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '400':
          description: Bad request
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: '`DataSource` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '200':
          description: '`DataSourceSchemaUpdate` response'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/DataSourceSchemaUpdate'
      parameters:
      - name: account
        in: path
        description: '`Account` (`Workspace` or `User`) username'
        required: true
        schema:
          type: string
      - name: data_source
        in: path
        description: '`DataSource` token'
        required: true
        schema:
          type: string
      tags:
      - Data Sources
  /{workspace}/data_sources:
    x-summary: DataSources
    get:
      operationId: listDataSources
      summary: List data sources
      description: Returns all `DataSource`s owned by a `Workspace`
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: '`Workspace` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '200':
          description: '`DataSource` collection response'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/DataSources'
      parameters:
      - name: workspace
        in: path
        description: '`Workspace` username'
        required: true
        schema:
          type: string
      tags:
      - Data Sources
  /{workspace}/data_sources/{data_source}:
    x-summary: Data Source
    get:
      operationId: getDataSource
      summary: Get a data source
      description: Returns a single `DataSource`
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: '`DataSource` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '200':
          description: '`DataSource` response'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/DataSource'
      parameters:
      - name: workspace
        in: path
        description: '`Workspace` username'
        required: true
        schema:
          type: string
      - name: data_source
        in: path
        description: '`DataSource` token'
        required: true
        schema:
          type: string
      tags:
      - Data Sources
    patch:
      operationId: updateDataSource
      summary: Update a data source
      description: Updates a `DataSource`
      parameters:
      - name: workspace
        in: path
        description: '`Workspace` username'
        required: true
        schema:
          type: string
      - name: data_source
        in: path
        description: '`DataSource` token'
        required: true
        schema:
          type: string
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '400':
          description: Bad request
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: '`DataSource` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '200':
          description: '`DataSource` response'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/DataSource'
      tags:
      - Data Sources
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDataSourceRequestBody'
  /{workspace}/data_sources/{data_source}/purge:
    x-summary: Data Source
    post:
      operationId: purgeForDataSource
      summary: Purge report results
      description: Removes all report results that use a data source
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '400':
          description: Bad request
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/BadRequest'
        '404':
          description: '`DataSource` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '202':
          description: Accepted
          content:
            application/hal+json:
              schema: {}
      parameters:
      - name: workspace
        in: path
        description: '`Workspace` username'
        required: true
        schema:
          type: string
      - name: data_source
        in: path
        description: '`DataSource` token'
        required: true
        schema:
          type: string
      tags:
      - Data Sources
  /{account}/data_sources/{data_source}/reports:
    x-summary: Reports
    get:
      operationId: listReportsUsingDataSource
      summary: List reports using a data source
      description: Returns all `Report`s using a `DataSource`
      responses:
        '401':
          description: Unauthorized
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Unauthorized'
        '404':
          description: '`Report` not found'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/NotFound'
        '200':
          description: '`Report` collection response'
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/Reports'
      parameters:
      - name: account
        in: path
        description: '`Account` (`Workspace` or `User`) username'
        required: true
        schema:
          type: string
      - name: data_source
        in: path
        description: '`DataSource` token'
        required: true
        schema:
          type: string
      - name: filter
        in: query
        description: 'Returns a filtered list of `Report`s in a `Space` filtered by whether their `created_at` or `updated_at` timestamps are `gt` (greater than) or `lt` (less than) the datetime passed in ISO8601 format. Example: `?filter=created_at.gt.2019-10-23T06:23:01Z` returns all `Reports` in a space created after that date.'
        required: false
        schema:
          type: string
      - name: order
        in: query
        description: 'With the `order` param, returns all `Report`s in a `Space` ordered in `asc` or `desc` order. Example: `?order=asc&order_by=created_at`'
        required: false
        schema:
          type: string
      - name: order_by
        in: query
        description: 'With the `order_by` param, returns all `Report`s in a `Space` ordered by their `created_at` or `updated_at` timestamps. Example: `?order_by=created_at&order=asc`'
        required: false
        schema:
          type: string
      tags:
      - Data Sources
components:
  schemas:
    BadRequest:
      required:
      - id
      - message
      properties:
        id:
          type: string
          enum:
          - bad_request
        message:
          type: string
    DataSources:
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        data_index_auth_token:
          type: string
        _links:
          $ref: '#/components/schemas/DataSourcesLinks'
        _embedded:
          $ref: '#/components/schemas/DataSourcesEmbeds'
      required:
      - _links
    Unauthorized:
      required:
      - id
      - message
      properties:
        id:
          type: string
          enum:
          - unauthorized
        message:
          type: string
    DataSourcesEmbeds: {}
    DataSourceSchemaUpdateEmbeds: {}
    Reports:
      properties:
        pagination:
          $ref: '#/components/schemas/Pagination'
        _links:
          $ref: '#/components/schemas/ReportsLinks'
        _embedded:
          $ref: '#/components/schemas/ReportsEmbeds'
      required:
      - _links
    ReportsLinks:
      properties:
        next_page:
          $ref: '#/components/schemas/Link'
        prev_page:
          $ref: '#/components/schemas/Link'
        self:
          $ref: '#/components/schemas/Link'
      required:
      - self
    DataSourceSchemaUpdateLinks:
      properties:
        self:
          $ref: '#/components/schemas/Link'
      required:
      - self
    NotFound:
      required:
      - id
      - message
      properties:
        id:
          type: string
          enum:
          - not_found
        message:
          type: string
    UpdateDataSourceRequestBody:
      required:
      - data_source
      type: object
      properties:
        data_source:
          type: object
          description: The parameters of the data source to update
          properties:
            name:
              type: string
              description: Name of the `data source`
              example: Redshift Database
            description:
              type: string
              description: Description of the `data source`
              example: Marketing data
            password:
              type: string
              description: Password for the `data source`
              example: redshift_db_pw
            custom_attributes:
              type: object
              description: For Oracle Autonomous Database connected via bridge, pass the connection string as a custom attribute
              properties:
                connection_string:
                  type: string
            certificate:
              type: string
              format: binary
            key:
              type: string
              format: binary
            wallet:
              type: string
              format: binary
    Link:
      required:
      - href
      properties:
        href:
          type: string
        templated:
          type: boolean
          default: false
    Pagination:
      required:
      - first_page
      - last_page
      - total_pages
      - total_count
      properties:
        first_page:
          type: string
        last_page:
          type: string
        total_pages:
          type: integer
        total_count:
          type: integer
    ReportsEmbeds: {}
    DataSourceSchemaUpdate:
      properties:
        id:
          type: string
        token:
          type: string
        state:
          type: string
        content_length:
          type: string
        number_of_schemas:
          type: string
        number_of_tables:
          type: string
        last_succesful_refresh_at:
          type: string
        webapp_uri:
          type: string
        _links:
          $ref: '#/components/schemas/DataSourceSchemaUpdateLinks'
        _embedded:
          $ref: '#/components/schemas/DataSourceSchemaUpdateEmbeds'
      required:
      - _links
      - id
      - token
      - state
      - content_length
      - number_of_schemas
      - number_of_tables
    DataSourceCustomAttributes:
      properties:
        standard_sql:
          type: boolean
    DataSourceEmbeds: {}
    DataSourceLinks:
      properties:
        self:
          $ref: '#/components/schemas/Link'
        creator:
          $ref: '#/components/schemas/Link'
        account:
          $ref: '#/components/schemas/Link'
        permissions:
          $ref: '#/components/schemas/Link'
        web:
          $ref: '#/components/schemas/Link'
        web_home:
          $ref: '#/components/schemas/Link'
      required:
      - self
      - creator
      - account
      - web
      - web_home
    DataSourcesLinks:
      properties:
        next_page:
          $ref: '#/components/schemas/Link'
        prev_page:
          $ref: '#/components/schemas/Link'
        self:
          $ref: '#/components/schemas/Link'
      required:
      - self
    DataSource:
      properties:
        id:
          type: integer
        name:
          type: string
        description:
          type: string
        token:
          type: string
        adapter:
          enum:
          - jdbc:athena
          - jdbc:bigquery
          - jdbc:databricks
          - jdbc:dbtmetrics
          - jdbc:denodo
          - jdbc:druid
          - jdbc:hive
          - jdbc:impala
          - jdbc:mysql
          - jdbc:oracle
          - jdbc:oracleadb
          - jdbc:postgresql
          - jdbc:trino
          - jdbc:presto
          - jdbc:clickhouse
          - jdbc:redshift
          - jdbc:snowflake
          - jdbc:spark
          - jdbc:sqlserver
          - jdbc:treasuredata
          - jdbc:vertica
          - jdbc:salesforce
          - jdbc:dbtsemanticlayer
          - jdbc:looker
          - jdbc:arrowflightsql
          - jdbc:modedatasets
          type: string
        created_at:
          type: string
        updated_at:
          type: string
        has_expensive_schema_updates:
          type: boolean
        public:
          type: boolean
        asleep:
          type: boolean
        queryable:
          type: boolean
        soft_deleted:
          type: boolean
        display_name:
          type: string
        account_id:
          type: integer
        account_username:
          type: string
        organization_token:
          type: string
        organization_plan_code:
          type: string
        database:
          type: string
        host:
          type: string
        port:
          type: string
        ssl:
          type: boolean
        username:
          type: string
        provider:
          type: string
        vendor:
          type: string
        ldap:
          type: boolean
        warehouse:
          type: string
        bridged:
          type: boolean
        adapter_version:
          type: string
        custom_attributes:
          $ref: '#/components/schemas/DataSourceCustomAttributes'
        ssl_trusted_cert:
          type: string
        default_access_level:
          type: string
        _links:
          $ref: '#/components/schemas/DataSourceLinks'
        _embedded:
          $ref: '#/components/schemas/DataSourceEmbeds'
      required:
      - _links
      - id
      - name
      - description
      - token
      - adapter
      - created_at
      - updated_at
      - has_expensive_schema_updates
      - public
      - asleep
      - queryable
      - soft_deleted
      - display_name
      - database
      - host
      - port
      - ssl
      - username
      - provider
      - vendor
      - ldap
      - warehouse
      - bridged
      - adapter_version
      - custom_attributes
  securitySchemes:
    accessTokenAuth:
      type: http
      scheme: basic