---
title: List patterns templates
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > Agent Observability
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# List patterns templates{% #list-patterns-templates %}

{% tab title="v2" %}
**Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).
| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| ap1.datadoghq.com | GET https://api.ap1.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates |
| ap2.datadoghq.com | GET https://api.ap2.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/llm-obs/v1/topic-discovery-templates      |
| app.ddog-gov.com  | GET https://api.ddog-gov.com/api/v2/llm-obs/v1/topic-discovery-templates      |
| us2.ddog-gov.com  | GET https://api.us2.ddog-gov.com/api/v2/llm-obs/v1/topic-discovery-templates  |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates |
| app.datadoghq.com | GET https://api.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates     |
| us3.datadoghq.com | GET https://api.us3.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates |
| us5.datadoghq.com | GET https://api.us5.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates |

### Overview

List all enabled patterns templates.

### Response

{% tab title="200" %}
OK
{% tab title="Model" %}
Response containing a list of Agent Observability patterns templates.

| Parent field | Field                                     | Type      | Description                                                                                                                       |
| ------------ | ----------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]                    | object    | Data object of a list of Agent Observability patterns templates.                                                                  |
| data         | attributes [*required*]              | object    | Attributes of a list of Agent Observability patterns templates.                                                                   |
| attributes   | templates [*required*]               | [object]  | List of patterns templates.                                                                                                       |
| templates    | clustering_instructions [*required*] | string    | Instructions guiding how topics are clustered for configurations linked to this template.                                         |
| templates    | created_at [*required*]              | date-time | Timestamp when the template was created.                                                                                          |
| templates    | description [*required*]             | string    | Human-readable description of what the template is for.                                                                           |
| templates    | evp_query_prefix [*required*]        | string    | Prefix merged into the query that selects spans for configurations linked to this template.                                       |
| templates    | id [*required*]                      | string    | Unique identifier of the template.                                                                                                |
| templates    | name [*required*]                    | string    | Name of the template.                                                                                                             |
| templates    | scope [*required*]                   | string    | Scope the template applies to.                                                                                                    |
| templates    | template [*required*]                | string    | Template used to guide topic generation for configurations linked to this template.                                               |
| templates    | time_frame_duration_ms [*required*]  | int64     | Default lookback window, in milliseconds, for configurations linked to this template.                                             |
| data         | id [*required*]                      | string    | Identifier of the list response.                                                                                                  |
| data         | type [*required*]                    | enum      | Resource type of a list of Agent Observability patterns templates. Allowed enum values: `list_topic_discovery_templates_response` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "templates": [
        {
          "clustering_instructions": "Group topics by user intent.",
          "created_at": "2024-01-15T10:30:00Z",
          "description": "A general-purpose starting point for topic discovery.",
          "evp_query_prefix": "",
          "id": "a7c8d9e0-1234-5678-9abc-def012345678",
          "name": "General",
          "scope": "span",
          "template": "{{span_input}}",
          "time_frame_duration_ms": 604800000
        }
      ]
    },
    "id": "topic_discovery_templates",
    "type": "list_topic_discovery_templates_response"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \# Use a Personal Access Token or Service Access Token export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"  \# Curl command curl -X GET "https://api.datadoghq.com/api/v2/llm-obs/v1/topic-discovery-templates" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" 

                
{% /tab %}
