List the Analytics Datasets

GET https://api.suger.cloud/ai/org/{orgId}/analytics/dataset

Lists the datasets the caller can query, each with its description, the names of its measures and segments, the datasets it relates to, its main `time` field, and how much data the organization has in it: `rows`, and the first and last day of its `time` field, or `no rows yet`. A dataset whose data could not be read now is listed without it, and `dataNotRead` says so. Read the datasets a question needs with GetAnalyticsDataset and the query grammar with GetAnalyticsQueryGrammar before writing a query. Plan from what the data covers: a short history rules out a change on the previous year and a long trend, and a dataset with no rows yet gets no chart, or one that says it has no data yet.

Parameters

NameInTypeRequiredDescription
orgId path string yes Organization ID

Responses

200 — The datasets

Content-Type: application/json · Schema: AnalyticsDatasetList

AnalyticsDatasetList fields:

FieldTypeRequiredDescription
datasets array<object> yes
dataNotRead string no Which datasets are listed without their `data`, and why.

401 — No valid token

Content-Type: application/json · Schema: AiErrorResponse

AiErrorResponse fields:

FieldTypeRequiredDescription
error string yes Error message

403 — Not a member of the organization

Content-Type: application/json · Schema: AiErrorResponse

AiErrorResponse fields:

FieldTypeRequiredDescription
error string yes Error message

500 — ANALYTICS_UNAVAILABLE: an unexpected failure

Content-Type: application/json · Schema: AnalyticsError

AnalyticsError fields:

FieldTypeRequiredDescription
error object yes

503 — ANALYTICS_UNAVAILABLE: analytics is not configured or not ready

Content-Type: application/json · Schema: AnalyticsError

AnalyticsError fields:

FieldTypeRequiredDescription
error object yes

Example

Generated from this operation's schema. Values are placeholders — substitute your own ids, and set SUGER_TOKEN to a bearer token from the OAuth client-credentials exchange.

Request

curl -X GET 'https://api.suger.cloud/ai/org/{orgId}/analytics/dataset' \
  -H "Authorization: Bearer $SUGER_TOKEN"

Response — 200

{
  "datasets": [
    {
      "name": "Acme Corp",
      "description": "string",
      "measures": [
        "string"
      ],
      "segments": [
        "string"
      ],
      "relatesTo": [
        "string"
      ],
      "time": "2026-01-31T12:00:00Z",
      "data": {
        "rows": 1,
        "first": "string",
        "last": "string"
      }
    }
  ],
  "dataNotRead": "string"
}

Error — 401

{
  "error": "string"
}

View as Markdown · API reference overview

Spotted something wrong or out of date on this page? Tell us and we'll correct it.