# Get template

URL: https://docs.hanzo.ai/docs/openapi/template/get-template-by-slug

> Returns one starter kit: the caller org's own by that slug, else the public catalog's.

`GET /v1/template/{slug}`

> [Template →](https://docs.hanzo.ai/docs/openapi/template) · [All API references →](https://docs.hanzo.ai/docs/openapi) · [Get started →](https://docs.hanzo.ai/docs/guides)

|               |                                           |
| ------------- | ----------------------------------------- |
| **Address**   | `https://api.hanzo.ai/v1/template/{slug}` |
| **Method**    | `GET`                                     |
| **Operation** | `get_template_by_slug`                    |
| **Auth**      | `Authorization: Bearer $HANZO_API_KEY`    |

Returns one starter kit: the caller org's own by that slug, else the public
catalog's. A slug another org owns reads as not found.

## Request

1 field.

| Field  | In   | Type   | Required | Description                                       |
| ------ | ---- | ------ | -------- | ------------------------------------------------- |
| `slug` | path | string | yes      | Slug is the starter kit to act on, from the path. |

## Response

| Status    | Body                | Meaning |
| --------- | ------------------- | ------- |
| `200`     | template.StarterKit | ok      |
| `default` | problem-details     | refused |

`200` body — 19 fields.

| Field                  | In   | Type                | Always | Description                                                                                                                                |
| ---------------------- | ---- | ------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
| `category`             | body | string              | —      | groups the kit in the gallery browser ("Portfolio", "SaaS")                                                                                |
| `demo`                 | body | string              | —      | live demo (\<slug>.hanzo.app), when deployed                                                                                               |
| `description`          | body | string              | —      | the browse-card blurb                                                                                                                      |
| `features`             | body | string\[]           | —      | the highlights the card lists, at most 32                                                                                                  |
| `framework`            | body | string              | —      | the stack the kit is built on ("Next.js 14.2 + TS")                                                                                        |
| `org`                  | body | string              | —      | owner of a PRIVATE template; empty in the public catalog                                                                                   |
| `preview`              | body | string              | —      | the still image the browse card renders                                                                                                    |
| `rating`               | body | number (double)     | —      | Rating is public-gallery curation, on the same terms as Tier: catalog-only, never accepted from a request, absent on a customer's own kit. |
| `slug`                 | body | string              | —      | the kit's identity — lowercase alphanumeric with dashes, max 40                                                                            |
| `source`               | body | string              | —      | the repository the kit is forked from                                                                                                      |
| `tier`                 | body | integer (int64)     | —      | Tier is public-gallery curation, carried verbatim from the embedded catalog.                                                               |
| `title`                | body | string              | —      | display name                                                                                                                               |
| `useCase`              | body | string              | —      | what the kit is for, in a phrase                                                                                                           |
| `variants`             | body | template.Variant\[] | —      | the shapes this template ships in                                                                                                          |
| `variants[].framework` | body | string              | —      | only when it differs from the template's                                                                                                   |
| `variants[].id`        | body | string              | —      | selector, unique within the template ("react", "grid-3-fluid")                                                                             |
| `variants[].kind`      | body | string              | —      | the axis it varies: format \| page \| theme                                                                                                |
| `variants[].label`     | body | string              | —      | human label for the picker                                                                                                                 |
| `variants[].source`    | body | string              | —      | the repository this shape is forked from; the synthesized default shape carries the template's own                                         |

Failure carries the platform error shape — see [Errors](https://docs.hanzo.ai/docs/errors).

## Examples

**CLI**

```bash
hanzo template get <slug>
```

**SDK**

**.ts**

```ts
import { Configuration, TemplateApi } from 'hanzoai';

const api = new TemplateApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getTemplateBySlug({ slug: 'slug' });
```

**.py**

```python
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import TemplateApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = TemplateApi(client).get_template_by_slug(slug='slug')
```

**.go**

```go
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.TemplateAPI.GetTemplateBySlug(context.Background()).Execute()
if err != nil {
	return err
}
```

**.rs**

```rust
use hanzo_client::apis::{configuration::Configuration, template_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = template_api::get_template_by_slug(&cfg, Default::default()).await?;
```

**.java**

```java
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.TemplateApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new TemplateApi(client).getTemplateBySlug();
```

**HTTP**

```bash
curl https://api.hanzo.ai/v1/template/<slug> \
  -H "Authorization: Bearer $HANZO_API_KEY"
```

**MCP**

Tool `template`, op `get_template_by_slug` — POST the JSON-RPC envelope to `https://api.hanzo.ai/v1/mcp`.

```bash
curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "template",
         "arguments": {
           "op": "get_template_by_slug",
           "input": {
             "slug": "<slug>"
           }
         }
       }
     }'
```

---

[Template API](https://docs.hanzo.ai/docs/openapi/template) · [All Hanzo APIs](https://docs.hanzo.ai/docs/openapi) · [Interactive reference](https://docs.hanzo.ai/docs/openapi/reference)
