# Get an Analytics Dataset

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

Gets a dataset the caller can query: its fields, measures, segments and relationships, with their types and descriptions, the names a query over it may use. A dataset the caller may not read, and a name no dataset has, answer DATASET_FORBIDDEN alike.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `name` | path | string | yes |  |

## Responses

### 200 — The dataset

Content-Type: `application/json` · Schema: `AnalyticsDataset`

**`AnalyticsDataset`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `description` | string | yes |  |
| `fields` | object | yes |  |
| `measures` | object | yes |  |
| `segments` | object | yes |  |
| `relationships` | object | yes |  |
| `name` | string | yes |  |

### 401 — No valid token

Content-Type: `application/json` · Schema: `AiErrorResponse`

**`AiErrorResponse`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | string | yes | Error message |

### 403 — Not a member of the organization, or DATASET_FORBIDDEN: the caller may not read a dataset of that name

Content-Type: `application/json`

### 500 — ANALYTICS_UNAVAILABLE: an unexpected failure

Content-Type: `application/json` · Schema: `AnalyticsError`

**`AnalyticsError`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | yes |  |

### 503 — ANALYTICS_UNAVAILABLE: analytics is not configured or not ready

Content-Type: `application/json` · Schema: `AnalyticsError`

**`AnalyticsError`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `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](https://doc.fours.com/settings/oauth-app/)._

### Request

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

### Response — 200

```json
{
  "description": "string",
  "fields": {},
  "measures": {},
  "segments": {},
  "relationships": {},
  "name": "Acme Corp"
}
```

### Error — 401

```json
{
  "error": "string"
}
```

---

API reference: https://doc.fours.com/api/
