---
title: "Get all data sources"
method: GET
path: "/api/v1/layout/dataSources"
tags: ["Data Source - Declarative APIs"]
---

# Get all data sources

`GET /api/v1/layout/dataSources`

## Request

- Base URL: `https://www.gooddata.ai`
- URL: `https://www.gooddata.ai/api/v1/layout/dataSources`
- Auth: none declared

Retrieve all data sources including related physical model.

## Response `200`

Retrieved all data sources.

- DeclarativeDataSources: A data source and its properties.
  - `dataSources` DeclarativeDataSource[], required
    - `alternativeDataSourceId` string, nullable: Alternative data source ID. It is a weak reference meaning data source does not have to exist. All the entities (e.g. tables) from the data source must be available also in the alternative data source. It must be present in the same organization as the data source.
    - `authenticationType` 'USERNAME_PASSWORD' | 'TOKEN' | 'KEY_PAIR' | 'CLIENT_SECRET' | 'OIDC_PASSTHROUGH', nullable: Type of authentication used to connect to the database.
    - `cacheRetention` union: Determines when the cached results coming from a particular data source expire. The shape is selected by the `type` property.
      - object: The cache never expires on its own; it is kept per `cacheStrategy` and invalidated only explicitly. Equivalent to setting no policy at all.
        - `type` 'INDEFINITE', required: The cache retention type.
      - object: The cache expires once a fixed period elapses since the results were computed.
        - `type` 'VALIDITY_PERIOD', required: The cache retention type.
        - `validityPeriod` string, duration, required: How long the cached results stay valid after they were computed.
      - object: The cache expires according to a schedule.
        - `schedule` CacheRetentionSchedule, required: A schedule determining when the cached results of a data source expire.
          - `cron` string, required: Cron expression determining when the cached results expire.
          - `timezone` string, nullable: Timezone the cron expression is evaluated in. Defaults to UTC when not set.
        - `type` 'SCHEDULE', required: The cache retention type.
    - `cacheStrategy` 'ALWAYS' | 'NEVER': Determines how the results coming from a particular datasource should be cached. - ALWAYS: The results from the datasource should be cached normally (the default). - NEVER: The results from the datasource should never be cached.
    - `clientId` string: Id of client with permission to connect to the data source.
    - `clientSecret` string: The client secret to use to connect to the database providing the data for the data source.
    - `dateTimeSemantics` 'LOCAL' | 'UTC', nullable: Determines how datetime values are interpreted in data sources without native support for specifying this. - LOCAL: The values are assumed to be in local timezone and they are not converted to the user's timezone. - UTC: The values are assumed to be in UTC and they are converted to the user's timezone.
    - `decodedParameters` Parameter[]
      - `name` string, required
      - `value` string, required
    - `disableStatistics` boolean, nullable: Whether to skip the collection of physical statistics from the database. Statistics are collected when this is false or unset.
    - `id` string, required: Data source ID.
    - `ignoreJwtAud` boolean, nullable: Turns off the check that the audience of an OIDC access token names the host of the data source, for the OIDC_PASSTHROUGH authentication type. Only an organization administrator may set it.
    - `name` string, required: Name of the data source.
    - `parameters` Parameter[]
      - `name` string, required
      - `value` string, required
    - `password` string: Password for the data-source user, property is never returned back.
    - `permissions` DeclarativeDataSourcePermission[]
      - `assignee` AssigneeIdentifier, required: Identifier of a user or user-group.
        - `id` string, required: Identifier of the assignee.
        - `type` 'user' | 'userGroup', required
      - `name` 'MANAGE' | 'USE', required: Permission name.
    - `privateKey` string, nullable: The private key to use to connect to the database providing the data for the data source.
    - `privateKeyPassphrase` string, nullable: The passphrase used to encrypt the private key.
    - `schema` string, required: A scheme/database with the data.
    - `token` string: Token as an alternative to username and password.
    - `type` 'POSTGRESQL' | 'REDSHIFT' | 'VERTICA' | 'SNOWFLAKE' | 'ADS' | 'BIGQUERY' | 'MSSQL' | 'PRESTO' | 'DREMIO' | 'AZURESQL' | 'SYNAPSESQL' | 'DATABRICKS' | 'GDSTORAGE' | 'CLICKHOUSE' | 'MYSQL' | 'MARIADB' | 'ORACLE' | 'PINOT' | 'SINGLESTORE' | 'MOTHERDUCK' | 'FLEXCONNECT' | 'STARROCKS' | 'ATHENA' | 'CRATEDB' | 'AILAKEHOUSE' | 'DENODO' | 'TRINO', required: Type of database.
    - `url` string: An connection string relevant to type of database.
    - `username` string: User with permission connect the data source/database.

---

[API](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api.md) - [All operations](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gooddata/apis/gooddata-cn-oapi-all-api/revisions/c728ef303bfb?raw)
