# List the app templates a project can be created from.

GET https://services.leadconnectorhq.com/ai-builder-api/catalog/templates

The template catalog powers the template picker on the landing page:
the starters, then the vertical templates (ready-made vibe apps that
the Jenkins `vertical-templates-release` publishes). Each entry has a
stable `id`, a `category`, a human-readable `name` + `summary`, a
`version`, and the `stackTemplate` a project from it is created on.
A vertical template also names the CP Elements products it `uses`, and
its card picture when it has one (`previewUrl`). Pass the chosen `id`
as `templateId` and its `stackTemplate` on `createProject`.


## Authentication

Send `Authorization: Bearer <token>` using:

- **Sub-Account token: OAuth access token or Private Integration Token.** Scopes: `clientportal-ai.readonly`

## Parameters

### Header Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `Version` | string | Yes | The API version. |

## OpenAPI Specification

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "HighLevel API",
    "version": "v3"
  },
  "servers": [
    {
      "url": "https://services.leadconnectorhq.com"
    }
  ],
  "paths": {
    "/ai-builder-api/catalog/templates": {
      "get": {
        "summary": "List the app templates a project can be created from.",
        "operationId": "listTheAppTemplatesAProjectCanBeCreatedFrom",
        "description": "The template catalog powers the template picker on the landing page:\nthe starters, then the vertical templates (ready-made vibe apps that\nthe Jenkins `vertical-templates-release` publishes). Each entry has a\nstable `id`, a `category`, a human-readable `name` + `summary`, a\n`version`, and the `stackTemplate` a project from it is created on.\nA vertical template also names the CP Elements products it `uses`, and\nits card picture when it has one (`previewUrl`). Pass the chosen `id`\nas `templateId` and its `stackTemplate` on `createProject`.\n",
        "parameters": [
          {
            "name": "Version",
            "in": "header",
            "required": true,
            "description": "The API version.",
            "schema": {
              "type": "string",
              "enum": [
                "v3"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Starter-template catalog snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTemplatesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": [
              "clientportal-ai.readonly"
            ]
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A sub-account access token: a Marketplace app's OAuth token or a Private Integration Token."
      }
    },
    "schemas": {
      "ListTemplatesResponse": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "description": "The starter templates a project can be created from.",
            "example": [
              {
                "id": "events-v1",
                "name": "Events & Ticketing",
                "category": "events",
                "summary": "Sell tickets, publish a schedule and check attendees in.",
                "version": "1.0.0",
                "stackTemplate": "nuxt_clientportal_vibe_v1"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "category",
                "summary",
                "version",
                "stackTemplate"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Stable starter-template id. Pass it as `templateId` on\n`createProject` to instantiate the project from this template.\n",
                  "example": "events-v1"
                },
                "name": {
                  "type": "string",
                  "description": "The template's name, as the template picker shows it.",
                  "example": "Events & Ticketing"
                },
                "category": {
                  "type": "string",
                  "description": "Coarse grouping for the template picker.",
                  "enum": [
                    "events",
                    "scheduling",
                    "portal",
                    "ai-chat",
                    "ecommerce"
                  ],
                  "example": "events"
                },
                "summary": {
                  "type": "string",
                  "description": "One-paragraph description of what the starter app does.",
                  "example": "Sell tickets, publish a schedule and check attendees in."
                },
                "version": {
                  "type": "string",
                  "description": "The template's version; a vertical template's is the commit it was published from.",
                  "example": "1.0.0"
                },
                "stackTemplate": {
                  "type": "string",
                  "description": "The stack a project from this template is created on; pass it as `stackTemplate` on `createProject`.",
                  "example": "nuxt_clientportal_vibe_v1"
                },
                "uses": {
                  "type": "array",
                  "description": "A vertical template's CP Elements products.",
                  "items": {
                    "type": "string"
                  },
                  "example": [
                    "Courses",
                    "Communities"
                  ]
                },
                "previewUrl": {
                  "type": "string",
                  "format": "uri",
                  "description": "A vertical template's card picture, when it has one.",
                  "example": "https://example.com/templates/learning-community.png"
                }
              },
              "title": "Template"
            }
          }
        },
        "title": "ListTemplatesResponse"
      }
    }
  }
}
```

## Code Examples

**cURL**

```bash
curl -L -X GET 'https://services.leadconnectorhq.com/ai-builder-api/catalog/templates' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Version: v3'
```

**Node.js**

```javascript
const options = {
  method: 'GET',
  headers: {
    Authorization: 'Bearer <TOKEN>',
    Version: 'v3'
  }
};

try {
  const response = await fetch('https://services.leadconnectorhq.com/ai-builder-api/catalog/templates', options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

**Python**

```python
import requests

url = "https://services.leadconnectorhq.com/ai-builder-api/catalog/templates"

headers = {
    "Authorization": "Bearer <TOKEN>",
    "Version": "v3"
}

response = requests.get(url, headers=headers)
print(response.json())
```

**PHP**

```php
<?php
$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => 'https://services.leadconnectorhq.com/ai-builder-api/catalog/templates',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => [
    'Authorization: Bearer <TOKEN>',
    'Version: v3',
  ],
]);

$response = curl_exec($curl);
curl_close($curl);
echo $response;
```

**Java**

```java
HttpResponse<String> response = Unirest
  .get("https://services.leadconnectorhq.com/ai-builder-api/catalog/templates")
  .header("Authorization", "Bearer <TOKEN>")
  .header("Version", "v3")
  .asString();
```

**Go**

```go
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {
  url := "https://services.leadconnectorhq.com/ai-builder-api/catalog/templates"
  req, _ := http.NewRequest("GET", url, nil)
  req.Header.Add("Authorization", "Bearer <TOKEN>")
  req.Header.Add("Version", "v3")

  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := io.ReadAll(res.Body)
  fmt.Println(string(body))
}
```

**Ruby**

```ruby
require 'uri'
require 'net/http'

url = URI("https://services.leadconnectorhq.com/ai-builder-api/catalog/templates")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = "Bearer <TOKEN>"
request["Version"] = "v3"

response = http.request(request)
puts response.read_body
```

**PowerShell**

```powershell
$headers = @{
  "Authorization" = "Bearer <TOKEN>"
  "Version" = "v3"
}

$response = Invoke-RestMethod -Uri 'https://services.leadconnectorhq.com/ai-builder-api/catalog/templates' -Method 'GET' -Headers $headers
$response | ConvertTo-Json
```
