> ## 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.

# Template

> Template endpoints: Create Metric Template, Get Metric Template, List Metric Templates, List Metric Template Metrics, Update Metric Template, Delete Metric Template

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

<Tabs>
  <Tab title="Create Metric Template">
    `POST /api/v1/metrics/template`

    Create a metric template.

    **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/template" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>" \
        -H "Content-Type: application/json" \
        -d '{}'
      ```
    </CodeGroup>

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

  <Tab title="Get Metric Template">
    `GET /api/v1/metrics/template/{templateId}`

    Get one metric template by ID.

    **Path Parameters**

    <ParamField path="templateId" type="string" required={true}>
      Example: \`\`
    </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">
      <ResponseField name="name" type="string">
        Example: `"NA_ADR_Completeness"`.
      </ResponseField>

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

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

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

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

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

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

      <ResponseField name="owner" type="object[]">
        <ResponseField name="id" type="string">
          Example: `"6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d"`.
        </ResponseField>

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

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

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

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

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

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

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

      <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="weightage" type="integer">
        Example: `100`.
      </ResponseField>

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

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

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

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

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

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

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

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

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

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

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

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

      <ResponseField name="id" type="string">
        Example: `"0cbd2200-a4bf-430f-8a9b-d49c55be64f0"`.
      </ResponseField>

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

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

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

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

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

      <ResponseField name="created_at" type="string">
        Example: `"2026-09-21T07:05:39.764359Z"`.
      </ResponseField>

      <ResponseField name="created_by" type="string">
        Example: `"6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d"`.
      </ResponseField>
    </ResponseField>

    **Example**

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

    ```json Response theme={null}
    {
      "success": true,
      "message": "Get one metric template by ID.",
      "timestamp": "2026-09-21T09:43:50.316067+00:00",
      "correlation_id": "1bff0823-3db2-4b12-bf56-22ea8d38bba2",
      "data": {
        "name": "NA_ADR_Completeness",
        "dimension": "Completeness",
        "status": "PENDING",
        "context": "Business",
        "category": "Query",
        "subcategory": "Parameter",
        "purpose": null,
        "owner": [
          {
            "id": "6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d",
            "name": "Ankush Guha",
            "label": "Ankush Guha",
            "owner_type": "Steward"
          }
        ],
        "audience": [],
        "detected_parameters": [],
        "properties": [],
        "pass_criteria": {},
        "threshold_constraint": {
          "auto": [],
          "mode": "auto",
          "custom": [],
          "manual": []
        },
        "weightage": 100,
        "enabled_total_records": false,
        "enabled_failed_rows": false,
        "enabled_export_rows": false,
        "column_limit": 20,
        "row_limit": 100,
        "is_aggregate": false,
        "allow_score": true,
        "auto_threshold": true,
        "mute_notification": false,
        "is_drift_enabled": true,
        "is_positive": false,
        "is_active": true,
        "id": "0cbd2200-a4bf-430f-8a9b-d49c55be64f0",
        "total_issue": 0,
        "total_alert": 0,
        "total_views": 0,
        "assigned_metric_count": 0,
        "segments": [],
        "created_at": "2026-09-21T07:05:39.764359Z",
        "created_by": "6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d"
      }
    }
    ```
  </Tab>

  <Tab title="List Metric Templates">
    `POST /api/v1/metrics/template/list`

    List metric templates with optional export.

    **Request Body**

    <ParamField body="pagination" type="object">
      <ParamField body="page" type="integer">
        Example: `1`.
      </ParamField>

      <ParamField body="pageSize" type="integer">
        Example: `10`.
      </ParamField>
    </ParamField>

    <ParamField body="sorting" type="object[]" />

    <ParamField body="filters" type="object[]" />

    <ParamField body="search" type="string">
      Example: `""`.
    </ParamField>

    <ParamField body="export" type="boolean">
      Example: `false`.
    </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">
      <ResponseField name="data" type="object[]">
        <ResponseField name="name" type="string">
          Example: `"NA_ADR_Completeness"`.
        </ResponseField>

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

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

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

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

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

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

        <ResponseField name="owner" type="object[]">
          <ResponseField name="id" type="string">
            Example: `"6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d"`.
          </ResponseField>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        <ResponseField name="id" type="string">
          Example: `"0cbd2200-a4bf-430f-8a9b-d49c55be64f0"`.
        </ResponseField>

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

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

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

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

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

        <ResponseField name="created_at" type="string">
          Example: `"2026-09-21T07:05:39.764359Z"`.
        </ResponseField>

        <ResponseField name="created_by" type="string">
          Example: `"6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d"`.
        </ResponseField>
      </ResponseField>

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

    **Example**

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST "https://<your-workspace>.prizmdata.ai/api/v1/metrics/template/list" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>" \
        -H "Content-Type: application/json" \
        -d '{
        "pagination": {
          "page": 1,
          "pageSize": 10
        },
        "sorting": [],
        "filters": [],
        "search": "",
        "export": false
      }'
      ```
    </CodeGroup>

    ```json Response theme={null}
    {
      "success": true,
      "message": "List metric templates with optional export.",
      "timestamp": "2026-09-21T09:43:50.316067+00:00",
      "correlation_id": "1bff0823-3db2-4b12-bf56-22ea8d38bba2",
      "data": {
        "data": [
          {
            "name": "NA_ADR_Completeness",
            "dimension": "Completeness",
            "status": "PENDING",
            "context": "Business",
            "category": "Query",
            "subcategory": "Parameter",
            "purpose": null,
            "owner": [
              {
                "id": "6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d",
                "name": "Ankush Guha",
                "label": "Ankush Guha",
                "owner_type": "Steward"
              }
            ],
            "audience": [],
            "detected_parameters": [],
            "properties": [],
            "pass_criteria": {},
            "threshold_constraint": {
              "mode": "auto",
              "auto": [],
              "custom": [],
              "manual": []
            },
            "weightage": 100,
            "enabled_total_records": false,
            "enabled_failed_rows": false,
            "enabled_export_rows": false,
            "column_limit": 20,
            "row_limit": 100,
            "is_aggregate": false,
            "allow_score": true,
            "auto_threshold": true,
            "mute_notification": false,
            "is_drift_enabled": false,
            "is_positive": true,
            "is_active": true,
            "id": "0cbd2200-a4bf-430f-8a9b-d49c55be64f0",
            "total_issue": 0,
            "total_alert": 0,
            "total_views": 0,
            "assigned_metric_count": 0,
            "segments": [],
            "created_at": "2026-09-21T07:05:39.764359Z",
            "created_by": "6ddf09b8-b3a2-4bad-95b1-17a6ac5ffc9d"
          }
        ],
        "total_count": 11
      }
    }
    ```
  </Tab>

  <Tab title="List Metric Template Metrics">
    `GET /api/v1/metrics/template/{templateId}/metrics`

    List metrics assigned to a template.

    **Path Parameters**

    <ParamField path="templateId" type="string" required={true}>
      Example: \`\`
    </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" />

    **Example**

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

    ```json Response theme={null}
    {
      "success": true,
      "message": "List metrics assigned to a template.",
      "timestamp": "2026-09-21T09:43:50.316067+00:00",
      "correlation_id": "1bff0823-3db2-4b12-bf56-22ea8d38bba2",
      "data": {}
    }
    ```
  </Tab>

  <Tab title="Update Metric Template">
    `PUT /api/v1/metrics/template/{templateId}`

    Update a metric template.

    **Path Parameters**

    <ParamField path="templateId" type="string" required={true}>
      Example: \`\`
    </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 PUT "https://<your-workspace>.prizmdata.ai/api/v1/metrics/template/{templateId}" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>" \
        -H "Content-Type: application/json" \
        -d '{}'
      ```
    </CodeGroup>

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

  <Tab title="Delete Metric Template">
    `DELETE /api/v1/metrics/template/{templateId}`

    Delete a metric template.

    **Path Parameters**

    <ParamField path="templateId" type="string" required={true}>
      Example: \`\`
    </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 DELETE "https://<your-workspace>.prizmdata.ai/api/v1/metrics/template/{templateId}" \
        -H "Authorization: Bearer <YOUR_API_TOKEN>"
      ```
    </CodeGroup>

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