Create Analytics Data Source
Create a data source, owned by the key's creator, for Analytics panels to read. A sync source fetches from an app's read action on a schedule and stores the rows: name the app, the action and a connection, with its arguments. A live source fetches from an action only when a drill-down opens, with that view's values. A merge combines your sync or fixed sources with SQL and code. A fixed source holds rows you send, up to 1,000, and is never refetched. A sync or merge source starts its first fetch now: follow it with Get Analytics Data Source Result. Incremental refreshes (fetching only changed records) stay off unless you set them with Update Analytics Data Source. An identical source you already have is reused rather than duplicated.
Headers
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.
Body
What kind of source: sync, live, merge or fixed.
syncFetched from an app action on a schedule and stored.liveFetched from an app action when a drill-down opens, with its values; never stored.mergeCombines other sources with SQL and code.fixedRows you supply; never refetched.
A name. Left out, one is written from what it fetches.
A name for the source. Left out, one is written from what it fetches.
What the data holds, in a sentence. Left out, one is written from the data.
For sync and live: the app, by id or slug, from List Universal Apps.
The app to fetch from, by id or slug, from List Universal Apps.
For sync and live: the app's read action, by id or slug, from List Universal Actions.
The app's read action, by id or slug, from List Universal Actions.
For sync and live: the connection to fetch with, from List Connections.
The connection to fetch with, from List Connections.
For sync and live: the action's arguments, as Get Universal Action lists them.
The action's arguments, { argumentKey: value }, as Get Universal Action lists them. Values may use date expressions such as {{now-2y}}.
For sync and live: the action's options.
The action's options, such as { "pagination": { "mode": "all" } }.
For sync and live: a filter and sort the app applies before the rows are stored.
A filter and sort the app applies before the rows are stored. The action must support them exactly, or the request is refused.
filteranyThe filter the app applies, as Get Universal Action describes it. Values must be literals.
sortanyThe sort the app applies.
For sync and merge: how often it refreshes in full, in seconds.
How often a sync or merge source refreshes in full, in seconds, up to 604800. A source that takes long to fetch may be held to a longer interval; the answer says what was set.
For merge: the sources to combine, each with an alias and optional SQL.
For a merge source: the sources it combines.
dataSourceIdstringrequiredThe input source, a sync or fixed source of yours, from List Analytics Data Sources.
aliasstringrequiredThe name the merge SQL and code read this input by.
querystringSQL that shapes this input before the merge, reading it as `src`. Leave it out to use the input as is.
For merge: JavaScript that receives each input by its alias and returns the combined rows.
For a merge source: JavaScript that receives each input by its alias and returns the combined rows. Required when there is more than one input.
For fixed: the rows, as objects with the same keys.
For a fixed source: the rows, as objects with the same keys, up to 1000. They replace the source's data.
Which columns hold dates, for page date filters. Left out, they are worked out from the data.
Which columns hold dates, for page date filters. Left out (or null on update), they are worked out from the data after each refresh.
primaryDateKeystringThe column page date filters use.
primaryDateKeyGrainstringThat column's grain, such as day or month.
createdDateKeystringThe column holding when each record was created.
updatedDateKeystringThe column holding when each record last changed.
hasNoDatesbooleanTrue when the source has no date column.
Response fields
idstringThe data source's id.
namestringThe data source's name.
descriptionstringWhat the data holds, in a sentence.
createdBystringThe userId of the member who created it, from List Members: the key's creator for their own sources.
typestringsync: 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.
synclivemergefixed
appIdstringThe app a sync or live source fetches from, from List Universal Apps. Null for merge and fixed sources.
actionIdstringThe app action it fetches with, from List Universal Actions. Null for merge and fixed sources.
actionNamestringThe app action's name.
connectionIdstringThe connection it fetches with, from List Connections. Null for merge and fixed sources.
statusstringWhere 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).
liveneverFetchednoDatadraftqueuedrefreshingreadyemptyfailed
rowCountnumberHow many rows the last fetch stored.
fetchedOndateWhen the stored rows were fetched.
messagestringWhy the last fetch failed, when it did.
refreshIntervalSecondsnumberHow often a sync or merge source refreshes in full, in seconds. Null for live and fixed sources.
isIncrementalEnabledbooleanFor a sync source, whether incremental refreshes (fetching only changed records between full refreshes) are switched on. Null for other types.
incrementalIntervalSecondsnumberHow often incremental refreshes run, in seconds, while they run. Null otherwise.
isPausedbooleanTrue when every page that uses it is paused or deleted, so its scheduled refresh is skipped.
panelCountnumberHow many panels on its owner's pages read it.
isUnusedbooleanTrue when no panel reads it and it has not changed for a day: the sources the app's cleanup offers to delete.
createdOndateWhen it was created.
updatedOndateWhen it last changed.
appVersionstringThe app version a sync or live source is pinned to.
latestAppVersionstringThe app's current published version, when the source is pinned to an older one. Null when it is current.
argumentsobjectThe action's arguments, as stored: each value in its stored form. Send them back as they are, or as plain values. Null for merge and fixed sources.
optionsobjectThe action's options, such as pagination. Null for merge and fixed sources.
queryobjectThe filter and sort the app applies before the rows are stored: { filter, sort }. Null when there is none.
inputsarray of objectsFor a merge source, the sources it combines. Null for other types.
dataSourceIdstringThe input source, from List Analytics Data Sources.
aliasstringThe name the merge SQL and code read this input by.
querystringThe SQL that shapes this input, reading it as `src`. Empty when it is used as is.
transformCodestringFor a merge source, the code that combines its inputs. Null for other types.
fileobjectFor a fixed source, the data it holds. Null for other types, or before any data is stored.
originstringWhere the rows came from. rows: rows sent in a request; attachment: an uploaded file; tableEditor: an edit to the table.
rowsattachmenttableEditor
filenamestringThe file's name, or the label given to rows sent in a request.
formatstringThe file format, such as csv, xlsx or json.
mimeTypestringThe file's media type.
sizeBytesnumberThe size of the stored data in bytes.
uploadedOndateWhen the data was stored.
rowCountnumberHow many rows the data holds.
sheetNamestringFor a spreadsheet, the sheet the rows are read from.
useHeaderbooleanFor a spreadsheet, whether its first row holds the column names.
removeTopRowsnumberFor a spreadsheet, how many rows above the header are skipped.
dateKeysobjectWhich columns hold dates, for page date filters. Null until they are known.
primaryDateKeystringThe column page date filters use for this source.
primaryDateKeyGrainstringThe primary date column's grain: day for dates, timestamp for dates with times.
createdDateKeystringThe column holding when each record was created.
updatedDateKeystringThe column holding when each record last changed.
hasNoDatesbooleanTrue when the source has no date column.
isIncrementalActivebooleanFor a sync source, whether incremental refreshes actually run: switched on, and the source can fetch only changed records. Null for other types.
incrementalobjectFor a sync source, how it fetches only changed records. Null when that was never set up.
statusstringWhether this source can fetch only changed records. active: it can; unavailable: it cannot.
activeunavailable
dedupKeyarrayThe field paths that identify a record, used to replace changed records.
sinceArgumentsobjectThe extra action arguments that ask the app for records changed since the last check.
catchesstringWhat the change check finds. newAndChanged: new and edited records; newOnly: new records only.
newAndChangednewOnly
overlapSecondsnumberHow far back before the last check each check looks, in seconds.
reasonstringWhy changed records cannot be fetched, when status is unavailable.
checkedOndateWhen these details were last checked against the source.
coverageobjectFor a sync source, how much time its stored rows span. Null when not measured.
codestringThe coverage verdict, such as COVERED, TRUNCATED or FILTER_NOT_APPLIED.
levelstringHow the verdict reads: ok, info or warn.
okinfowarn
messagestringThe verdict in words.
coverageFromdateThe earliest record date the data holds.
coverageTodateThe latest record date the data holds.