# List Analytics Data Sources

See the data sources of the key's creator: the app data, merges and tables their Analytics panels read. Each comes with its type, the app and action it fetches with, and how fresh its data is. Find one by name with q. Sources are owned per person, so another member's sources are not listed; read one a shared page uses through Get Analytics Data Source Result with that page's id. Check this list before you create a source: reuse one that already holds what you need.

`GET https://connect.mindcloud.co/v2/analytics/data-sources`

Permissions: `analytics:page:view`.

## Parameters

### Headers

- `X-Company-Id` (string): Optional. The id of the organization to act in. Leave it out to act in the API key's own organization. Here a key acts in another organization only as one of its members: with "Use this key across all of your organizations" on, in an organization its creator belongs to with a role. Child organizations and MindCloud staff access do not reach this endpoint. Every response's X-Company-Id header names the organization it acted in. See [Organizations](https://mindcloud.co/docs/api/rest/introduction/organizations).

### Query

- `q` (string): Search text: a name, or part of one, or an exact id.
  Search text: sources whose name contains it (case-insensitive; * matches anything), or whose id is exactly it.

## Example request

```bash
curl --request GET \
  --url 'https://connect.mindcloud.co/v2/analytics/data-sources?q=deals' \
  --header 'Authorization: Bearer $MINDCLOUD_API_TOKEN'
```

## Response fields

- `id` (string): The data source's id.
- `name` (string): The data source's name.
- `description` (string): What the data holds, in a sentence.
- `createdBy` (string): The userId of the member who created it, from List Members: the key's creator for their own sources.
- `type` (string): sync: fetched from an app action on a schedule and stored; live: fetched from an app action when a drill-down opens, with its values, and never stored; merge: combines other sources with SQL and code; fixed: rows you supply, never refetched.
  Allowed values:
    - `sync`
    - `live`
    - `merge`
    - `fixed`
- `appId` (string): The app a sync or live source fetches from, from List Universal Apps. Null for merge and fixed sources.
- `actionId` (string): The app action it fetches with, from List Universal Actions. Null for merge and fixed sources.
- `actionName` (string): The app action's name.
- `connectionId` (string): The connection it fetches with, from List Connections. Null for merge and fixed sources.
- `status` (string): Where its data stands. live: a live source, which has no stored data; neverFetched: no fetch has run yet; noData: a fixed source with no rows yet; draft: waiting for its first fetch; queued: a fetch is waiting to start; refreshing: a fetch is running; ready: its rows are stored; empty: the last fetch returned no rows; failed: the last fetch failed (see message).
  Allowed values:
    - `live`
    - `neverFetched`
    - `noData`
    - `draft`
    - `queued`
    - `refreshing`
    - `ready`
    - `empty`
    - `failed`
- `rowCount` (number): How many rows the last fetch stored.
- `fetchedOn` (date): When the stored rows were fetched.
- `message` (string): Why the last fetch failed, when it did.
- `refreshIntervalSeconds` (number): How often a sync or merge source refreshes in full, in seconds. Null for live and fixed sources.
- `isIncrementalEnabled` (boolean): For a sync source, whether incremental refreshes (fetching only changed records between full refreshes) are switched on. Null for other types.
- `incrementalIntervalSeconds` (number): How often incremental refreshes run, in seconds, while they run. Null otherwise.
- `isPaused` (boolean): True when every page that uses it is paused or deleted, so its scheduled refresh is skipped.
- `panelCount` (number): How many panels on its owner's pages read it.
- `isUnused` (boolean): True when no panel reads it and it has not changed for a day: the sources the app's cleanup offers to delete.
- `createdOn` (date): When it was created.
- `updatedOn` (date): When it last changed.
