---
title: List patterns templates
description: List all enabled patterns templates.
breadcrumbs: ドキュメント > API > List patterns templates
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# List patterns templates

## v2 (latest)

{% alert level="warning" %}
**Note**: This endpoint is in preview and is subject to change.
If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help.md).
{% /alert %}

| Datadog site      | API endpoint                                                                  |
| ----------------- | ----------------------------------------------------------------------------- |
| 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 |
| app.datadoghq.eu  | GET https://api.datadoghq.eu/api/v2/llm-obs/v1/topic-discovery-templates      |
| 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 |
| uk1.datadoghq.com | GET https://api.uk1.datadoghq.com/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  |

### Overview

List all enabled patterns templates.

### Response

{% tabs %}
{% tab label="200" %}
OK

{% tabs %}
{% tab label="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 label="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 %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
API error response.

| Field               | Type     | Description       |
| ------------------- | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/llm-obs/v1/topic-discovery-templates" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
```
{% /tab %}
{% /tabs %}
