---
title: "Get query templates"
---

> Documentation Index
> Fetch the complete documentation index at: https://developer.channelautomations.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Channel Automation API › Analytics

`GET /api/analytics/templates`

## Authentication

Requires one of the following:

- `bearerAuth`
- `apiKey`

## Query parameters

- `category` (`get/api/analytics/templates.query.category`; string, optional) — Filter templates by category
  - one of `"lead_conversion"`, `"messaging"`, `"webhook"`, `"performance"`

## Code samples

### cURL

```bash
curl --request GET \
  --url https://api.channelautomation.com/api/analytics/templates
```

### TypeScript

```typescript
const url = 'https://api.channelautomation.com/api/analytics/templates';
const options = {method: 'GET'};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.channelautomation.com/api/analytics/templates"

response = requests.get(url)

print(response.text)
```

## Responses

### 200

List of query templates

#### Example

```json
[
  {
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "description": "string",
    "category": "lead_conversion",
    "query_config": {},
    "sql_template": "string",
    "visualization_type": "table",
    "is_public": true
  }
]
```

- `id` (`get/api/analytics/templates.response.200.id`; string, optional)
  - format `uuid`
- `name` (`get/api/analytics/templates.response.200.name`; string, optional)
- `description` (`get/api/analytics/templates.response.200.description`; string, optional)
- `category` (`get/api/analytics/templates.response.200.category`; string, optional)
  - one of `"lead_conversion"`, `"messaging"`, `"webhook"`, `"performance"`
- `query_config` (`get/api/analytics/templates.response.200.query_config`; object, optional)
- `sql_template` (`get/api/analytics/templates.response.200.sql_template`; string, optional)
- `visualization_type` (`get/api/analytics/templates.response.200.visualization_type`; string, optional)
  - one of `"table"`, `"chart"`, `"metric"`
- `is_public` (`get/api/analytics/templates.response.200.is_public`; boolean, optional)

### 500

Server error

#### Example

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

- `error` (`get/api/analytics/templates.response.500.error`; string, optional)
- `details` (`get/api/analytics/templates.response.500.details`; string, optional)


Source: https://developer.channelautomations.com/api/get-api-analytics-templates/index.md
