> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dqlabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Views

> Views endpoints: Get Export Data, Get Metrics From Latest View, Get Metric Latest

<script type="application/ld+json">
  {`{
            "@context": "https://schema.org",
            "@type": "TechArticle",
            "headline": "Views",
            "description": "Views endpoints: Get Export Data, Get Metrics From Latest View, Get Metric Latest",
            "url": "https://docs.dqlabs.ai/api-reference/metrics/views",
            "publisher": {
              "@type": "Organization",
              "name": "DQLabs Inc",
              "logo": "https://media.brand.dev/332adc35-5bc4-4d2b-bf78-256aa4a5e414.svg"
            }
            }`}
</script>

<Tabs>
  <Tab title="Get Export Data">
    `POST /api/v1/metrics/views/export`

    Get Export Data

    **Response**

    <ResponseField name="success" type="boolean">Whether the request completed successfully</ResponseField>

    <ResponseField name="message" type="string">Human-readable result message</ResponseField>

    <ResponseField name="timestamp" type="string">ISO 8601 server timestamp</ResponseField>

    <ResponseField name="correlation_id" type="string">Unique ID for this request</ResponseField>

    <ResponseField name="data" type="object">The endpoint's response payload.</ResponseField>

    **Example**

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST "https://<your-workspace>.prizmdata.ai/api/v1/metrics/views/export" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>" \
        -H "Content-Type: application/json" \
        -d '{}'
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "success": true,
      "message": "Get Export Data",
      "timestamp": "2026-09-21T09:43:50.316067+00:00",
      "correlation_id": "1bff0823-3db2-4b12-bf56-22ea8d38bba2",
      "data": {}
    }
    ```
  </Tab>

  <Tab title="Get Metrics From Latest View">
    `POST /api/v1/metrics/views/metric-latest`

    Get metrics from metric list with filters and pagination.

    **Response**

    <ResponseField name="success" type="boolean">Whether the request completed successfully</ResponseField>

    <ResponseField name="message" type="string">Human-readable result message</ResponseField>

    <ResponseField name="timestamp" type="string">ISO 8601 server timestamp</ResponseField>

    <ResponseField name="correlation_id" type="string">Unique ID for this request</ResponseField>

    <ResponseField name="data" type="object">
      <ResponseField name="data" type="object[]">
        <ResponseField name="tag" type="object[]" />

        <ResponseField name="term" type="object[]">
          <ResponseField name="id" type="string">
            Example: `"cea69567-190d-47b7-b507-c58126775b6e"`.
          </ResponseField>

          <ResponseField name="name" type="string">
            Example: `"term_governance"`.
          </ResponseField>

          <ResponseField name="label" type="string">
            Example: `"term_governance"`.
          </ResponseField>

          <ResponseField name="datatype" type="string">
            Example: `"text"`.
          </ResponseField>
        </ResponseField>

        <ResponseField name="level" type="string">
          Example: `"Attribute"`.
        </ResponseField>

        <ResponseField name="owner" type="object[]" />

        <ResponseField name="query" type="string">
          Example: `" SELECT COUNT(*) FROM \"dqlabs\".\"dbo\".\"ACTIONFIGURE\" WHERE \"TOY_ID\" IS NULL"`.
        </ResponseField>

        <ResponseField name="score" type="integer">
          Example: `100`.
        </ResponseField>

        <ResponseField name="alerts" type="integer">
          Example: `0`.
        </ResponseField>

        <ResponseField name="domain" type="object[]" />

        <ResponseField name="issues" type="integer">
          Example: `0`.
        </ResponseField>

        <ResponseField name="status" type="string">
          Example: `"PENDING"`.
        </ResponseField>

        <ResponseField name="context" type="string">
          Example: `"Semantic"`.
        </ResponseField>

        <ResponseField name="is_pass" type="string" />

        <ResponseField name="metrics" type="object" />

        <ResponseField name="parents" type="object[]">
          <ResponseField name="id" type="string">
            Example: `"d59eb4a6-58ca-4cb9-8e4d-e40e09e3ce06"`.
          </ResponseField>

          <ResponseField name="name" type="string">
            Example: `"dqlabs"`.
          </ResponseField>

          <ResponseField name="type" type="string">
            Example: `"DATABASE"`.
          </ResponseField>
        </ResponseField>

        <ResponseField name="product" type="object[]" />

        <ResponseField name="purpose" type="string" />

        <ResponseField name="term_id" type="string">
          Example: `"cea69567-190d-47b7-b507-c58126775b6e"`.
        </ResponseField>

        <ResponseField name="asset_id" type="string">
          Example: `"dfbbb658-42e0-44be-9613-1e9cfeb39b4e"`.
        </ResponseField>

        <ResponseField name="category" type="string">
          Example: `"Query"`.
        </ResponseField>

        <ResponseField name="dimension" type="string">
          Example: `"Consistency"`.
        </ResponseField>

        <ResponseField name="is_active" type="boolean">
          Example: `true`.
        </ResponseField>

        <ResponseField name="is_delete" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="metric_id" type="string">
          Example: `"34185116-fbca-4ad6-883e-b8bfbb807a54"`.
        </ResponseField>

        <ResponseField name="rationale" type="string" />

        <ResponseField name="row_limit" type="integer">
          Example: `100`.
        </ResponseField>

        <ResponseField name="source_id" type="string">
          Example: `"0f68b6c5-c9d9-49ee-900f-f212b1324d8b"`.
        </ResponseField>

        <ResponseField name="threshold" type="object">
          <ResponseField name="lower_threshold" type="number">
            Example: `0.0`.
          </ResponseField>

          <ResponseField name="upper_threshold" type="number">
            Example: `0.0`.
          </ResponseField>
        </ResponseField>

        <ResponseField name="weightage" type="integer">
          Example: `100`.
        </ResponseField>

        <ResponseField name="asset_name" type="string">
          Example: `"TOY_ID"`.
        </ResponseField>

        <ResponseField name="asset_type" type="string">
          Example: `"ATTRIBUTE"`.
        </ResponseField>

        <ResponseField name="created_at" type="string">
          Example: `"2026-09-20T19:07:22.142959+00:00"`.
        </ResponseField>

        <ResponseField name="created_by" type="string">
          Example: `"87efd845-c1f5-4c65-8a2a-1ecc91736c30"`.
        </ResponseField>

        <ResponseField name="is_default" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="properties" type="string" />

        <ResponseField name="run_status" type="string">
          Example: `"COMPLETED"`.
        </ResponseField>

        <ResponseField name="ai_insights" type="object">
          <ResponseField name="summary" type="string">
            Example: `"This metric measures the consistency of semantic terms within the query context, ensuring that glossary terms are used accurately and uniformly. It is applied at the term level within a semantic glossary asset, focusing on the consistency dimension. The metric is evaluated periodically using aggregation logic relevant to semantic consistency checks, although specific frequency details are not provided. Maintaining semantic consistency is crucial for data trust as it ensures clear and unambiguous communication of data definitions, supporting reliable data interpretation and decision-making."`.
          </ResponseField>
        </ResponseField>

        <ResponseField name="allow_score" type="boolean">
          Example: `true`.
        </ResponseField>

        <ResponseField name="application" type="object[]" />

        <ResponseField name="description" type="string" />

        <ResponseField name="is_approved" type="boolean">
          Example: `true`.
        </ResponseField>

        <ResponseField name="is_positive" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="metric_name" type="string">
          Example: `"METRIC2"`.
        </ResponseField>

        <ResponseField name="metric_type" type="string">
          Example: `"custom"`.
        </ResponseField>

        <ResponseField name="modified_at" type="string">
          Example: `"2026-09-20T19:11:02.563761+00:00"`.
        </ResponseField>

        <ResponseField name="modified_by" type="string">
          Example: `"87efd845-c1f5-4c65-8a2a-1ecc91736c30"`.
        </ResponseField>

        <ResponseField name="recent_runs" type="object[]">
          <ResponseField name="range" type="string" />

          <ResponseField name="run_id" type="string">
            Example: `"41f2655f-8b4f-4979-8a8b-80bfa88d8574"`.
          </ResponseField>

          <ResponseField name="marked_as" type="string" />

          <ResponseField name="collected_at" type="string">
            Example: `"2026-09-20 19:10:48.285349+00"`.
          </ResponseField>

          <ResponseField name="alert_priority" type="string">
            Example: `"OK"`.
          </ResponseField>
        </ResponseField>

        <ResponseField name="source_name" type="string">
          Example: `"mssql_regression"`.
        </ResponseField>

        <ResponseField name="source_type" type="string">
          Example: `"MSSQL"`.
        </ResponseField>

        <ResponseField name="subcategory" type="string">
          Example: `"Glossary"`.
        </ResponseField>

        <ResponseField name="column_limit" type="integer">
          Example: `20`.
        </ResponseField>

        <ResponseField name="is_aggregate" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="is_validated" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="job_asset_id" type="string" />

        <ResponseField name="metric_value" type="integer">
          Example: `0`.
        </ResponseField>

        <ResponseField name="error_message" type="string" />

        <ResponseField name="latest_run_id" type="string">
          Example: `"41f2655f-8b4f-4979-8a8b-80bfa88d8574"`.
        </ResponseField>

        <ResponseField name="pass_criteria" type="object" />

        <ResponseField name="total_records" type="integer">
          Example: `634067`.
        </ResponseField>

        <ResponseField name="valid_records" type="integer">
          Example: `634067`.
        </ResponseField>

        <ResponseField name="auto_threshold" type="boolean">
          Example: `true`.
        </ResponseField>

        <ResponseField name="qualified_name" type="string">
          Example: `"\"dqlabs\".\"dbo\".\"ACTIONFIGURE\".\"TOY_ID\""`.
        </ResponseField>

        <ResponseField name="table_asset_id" type="string">
          Example: `"3a33afad-d5db-4334-b18e-acf020755907"`.
        </ResponseField>

        <ResponseField name="disable_scoring" type="string" />

        <ResponseField name="invalid_records" type="integer">
          Example: `0`.
        </ResponseField>

        <ResponseField name="is_ai_generated" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="schema_asset_id" type="string">
          Example: `"f053504c-1608-4684-9d80-5052718daab5"`.
        </ResponseField>

        <ResponseField name="is_drift_enabled" type="boolean">
          Example: `true`.
        </ResponseField>

        <ResponseField name="metric_detail_id" type="string">
          Example: `"0b8b4378-e006-48f7-a1a5-e280603321b2"`.
        </ResponseField>

        <ResponseField name="valid_percentage" type="integer">
          Example: `100`.
        </ResponseField>

        <ResponseField name="database_asset_id" type="string">
          Example: `"d59eb4a6-58ca-4cb9-8e4d-e40e09e3ce06"`.
        </ResponseField>

        <ResponseField name="failed_rows_query" type="string" />

        <ResponseField name="pipeline_asset_id" type="string" />

        <ResponseField name="invalid_percentage" type="integer">
          Example: `0`.
        </ResponseField>

        <ResponseField name="metric_detail_type" type="string">
          Example: `"custom"`.
        </ResponseField>

        <ResponseField name="metric_template_id" type="string" />

        <ResponseField name="enabled_export_rows" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="enabled_failed_rows" type="boolean">
          Example: `false`.
        </ResponseField>

        <ResponseField name="is_metric_validated" type="boolean">
          Example: `true`.
        </ResponseField>

        <ResponseField name="metric_collected_at" type="string">
          Example: `"2026-09-20T19:10:48.285349+00:00"`.
        </ResponseField>

        <ResponseField name="total_records_query" type="string" />

        <ResponseField name="metric_template_name" type="string" />

        <ResponseField name="threshold_constraint" type="object">
          <ResponseField name="auto" type="string[]" />

          <ResponseField name="mode" type="string">
            Example: `"auto"`.
          </ResponseField>

          <ResponseField name="custom" type="object[]" />

          <ResponseField name="manual" type="object[]" />
        </ResponseField>

        <ResponseField name="enabled_total_records" type="boolean">
          Example: `false`.
        </ResponseField>
      </ResponseField>

      <ResponseField name="total_count" type="integer">
        Example: `65761`.
      </ResponseField>

      <ResponseField name="metrics" type="object[]">
        <ResponseField name="type" type="string">
          Example: `"Availability"`.
        </ResponseField>

        <ResponseField name="title" type="string">
          Example: `"Availability"`.
        </ResponseField>

        <ResponseField name="value" type="integer">
          Example: `32641`.
        </ResponseField>
      </ResponseField>
    </ResponseField>

    **Example**

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST "https://<your-workspace>.prizmdata.ai/api/v1/metrics/views/metric-latest" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>" \
        -H "Content-Type: application/json" \
        -d '{}'
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "success": true,
      "message": "Get metrics from metric list with filters and pagination.",
      "timestamp": "2026-09-21T09:43:50.316067+00:00",
      "correlation_id": "1bff0823-3db2-4b12-bf56-22ea8d38bba2",
      "data": {
        "data": [
          {
            "tag": [],
            "term": [
              {
                "id": "cea69567-190d-47b7-b507-c58126775b6e",
                "name": "term_governance",
                "label": "term_governance",
                "datatype": "text"
              }
            ],
            "level": "Attribute",
            "owner": [],
            "query": " SELECT COUNT(*) FROM \"dqlabs\".\"dbo\".\"ACTIONFIGURE\" WHERE \"TOY_ID\" IS NULL",
            "score": 100,
            "alerts": 0,
            "domain": [],
            "issues": 0,
            "status": "PENDING",
            "context": "Semantic",
            "is_pass": null,
            "metrics": {},
            "parents": [
              {
                "id": "d59eb4a6-58ca-4cb9-8e4d-e40e09e3ce06",
                "name": "dqlabs",
                "type": "DATABASE"
              }
            ],
            "product": [],
            "purpose": null,
            "term_id": "cea69567-190d-47b7-b507-c58126775b6e",
            "asset_id": "dfbbb658-42e0-44be-9613-1e9cfeb39b4e",
            "category": "Query",
            "dimension": "Consistency",
            "is_active": true,
            "is_delete": false,
            "metric_id": "34185116-fbca-4ad6-883e-b8bfbb807a54",
            "rationale": null,
            "row_limit": 100,
            "source_id": "0f68b6c5-c9d9-49ee-900f-f212b1324d8b",
            "threshold": {
              "lower_threshold": 0.0,
              "upper_threshold": 0.0
            },
            "weightage": 100,
            "asset_name": "TOY_ID",
            "asset_type": "ATTRIBUTE",
            "created_at": "2026-09-20T19:07:22.142959+00:00",
            "created_by": "87efd845-c1f5-4c65-8a2a-1ecc91736c30",
            "is_default": false,
            "properties": null,
            "run_status": "COMPLETED",
            "ai_insights": {
              "summary": "This metric measures the consistency of semantic terms within the query context, ensuring that glossary terms are used accurately and uniformly. It is applied at the term level within a semantic glossary asset, focusing on the consistency dimension. The metric is evaluated periodically using aggregation logic relevant to semantic consistency checks, although specific frequency details are not provided. Maintaining semantic consistency is crucial for data trust as it ensures clear and unambiguous communication of data definitions, supporting reliable data interpretation and decision-making."
            },
            "allow_score": true,
            "application": [],
            "description": null,
            "is_approved": true,
            "is_positive": false,
            "metric_name": "METRIC2",
            "metric_type": "custom",
            "modified_at": "2026-09-20T19:11:02.563761+00:00",
            "modified_by": "87efd845-c1f5-4c65-8a2a-1ecc91736c30",
            "recent_runs": [
              {
                "range": null,
                "run_id": "41f2655f-8b4f-4979-8a8b-80bfa88d8574",
                "marked_as": null,
                "collected_at": "2026-09-20 19:10:48.285349+00",
                "alert_priority": "OK"
              }
            ],
            "source_name": "mssql_regression",
            "source_type": "MSSQL",
            "subcategory": "Glossary",
            "column_limit": 20,
            "is_aggregate": false,
            "is_validated": false,
            "job_asset_id": null,
            "metric_value": 0,
            "error_message": null,
            "latest_run_id": "41f2655f-8b4f-4979-8a8b-80bfa88d8574",
            "pass_criteria": {},
            "total_records": 634067,
            "valid_records": 634067,
            "auto_threshold": true,
            "qualified_name": "\"dqlabs\".\"dbo\".\"ACTIONFIGURE\".\"TOY_ID\"",
            "table_asset_id": "3a33afad-d5db-4334-b18e-acf020755907",
            "disable_scoring": null,
            "invalid_records": 0,
            "is_ai_generated": false,
            "schema_asset_id": "f053504c-1608-4684-9d80-5052718daab5",
            "is_drift_enabled": true,
            "metric_detail_id": "0b8b4378-e006-48f7-a1a5-e280603321b2",
            "valid_percentage": 100,
            "database_asset_id": "d59eb4a6-58ca-4cb9-8e4d-e40e09e3ce06",
            "failed_rows_query": null,
            "pipeline_asset_id": null,
            "invalid_percentage": 0,
            "metric_detail_type": "custom",
            "metric_template_id": null,
            "enabled_export_rows": false,
            "enabled_failed_rows": false,
            "is_metric_validated": true,
            "metric_collected_at": "2026-09-20T19:10:48.285349+00:00",
            "total_records_query": null,
            "metric_template_name": null,
            "threshold_constraint": {
              "auto": [],
              "mode": "auto",
              "custom": [],
              "manual": []
            },
            "enabled_total_records": false
          }
        ],
        "total_count": 65761,
        "metrics": [
          {
            "type": "Availability",
            "title": "Availability",
            "value": 32641
          }
        ]
      }
    }
    ```
  </Tab>

  <Tab title="Get Metric Latest">
    `GET /api/v1/metrics/views/{metricDetailId}`

    Get metric latest by metric\_detail\_id

    **Path Parameters**

    <ParamField path="metricDetailId" type="string" required={true}>
      Example: `3fa85f64-5717-4562-b3fc-2c963f66afa6`
    </ParamField>

    **Response**

    <ResponseField name="success" type="boolean">Whether the request completed successfully</ResponseField>

    <ResponseField name="message" type="string">Human-readable result message</ResponseField>

    <ResponseField name="timestamp" type="string">ISO 8601 server timestamp</ResponseField>

    <ResponseField name="correlation_id" type="string">Unique ID for this request</ResponseField>

    <ResponseField name="data" type="object">The endpoint's response payload.</ResponseField>

    **Example**

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X GET "https://<your-workspace>.prizmdata.ai/api/v1/metrics/views/{metricDetailId}" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>"
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "success": true,
      "message": "Get metric latest by metric_detail_id",
      "timestamp": "2026-09-21T09:43:50.316067+00:00",
      "correlation_id": "1bff0823-3db2-4b12-bf56-22ea8d38bba2",
      "data": {}
    }
    ```
  </Tab>
</Tabs>
