---
title: "List template categories and industries"
method: GET
path: "/public-api/v1/template_categories"
tags: ["Templates"]
---

# List template categories and industries

`GET /public-api/v1/template_categories`

## Request

- Base URL: `https://app.hellobonsai.com`
- URL: `https://app.hellobonsai.com/public-api/v1/template_categories`
- Auth: one of:
  - OAuth 2
    - Authorization code: `https://app.hellobonsai.com/oauth/authorize`
    - Token URL: `https://app.hellobonsai.com/oauth/token`
  - HTTP bearer

Lists the names you can pass to `filter[category]` and `filter[industry]`
when listing templates of one type. Both kinds come back in one list, the
categories first; read `kind` to tell which filter a name feeds.

`filter[type]` is required and today accepts only `Doc`, matching the one
kind of template the API lists. It is required rather than assumed so
that adding a type later cannot change what an existing call returns.

The list is Bonsai's fixed vocabulary, the same for every account, so it
is worth fetching once and keeping. It is not a list of names that have
templates behind them right now — filtering by one that does not will
return an empty page. Your own saved templates are all filed under the
`My Templates` category.

## Filtering

- `filter[type]` — required. `Doc`, the template type the names belong to.
- `filter[kind]` — `category` or `industry`. Worth sending: each kind
  fits in a single page, the two together may not.
- `filter[name]` — partial, case-insensitive match on the name.

## Query parameters

- `page[number]` integer
- `page[size]` integer
- `filter[type]` 'Doc', required
- `filter[kind]` 'category' | 'industry'
- `filter[name]` string

## Response `200`

A page of category and industry names, categories first.

- object
  - `data` TemplateCategory[], required
    - `name` string, nullable, required: The name itself. Pass it verbatim to the filter named by `kind`.
    - `kind` string, required: Which filter on the template list accepts this name: `category` feeds `filter[category]`, `industry` feeds `filter[industry]`.
  - `meta` PaginatedMeta, required: Metadata returned alongside every list response.
    - `request_id` string, required: Identifier for this request. Quote it when contacting support about a specific call.
    - `pagination` Pagination, required: Where the returned page sits in the full result set.
      - `page` integer, required: The page that was returned.
      - `page_size` integer, required: How many records this page can hold.
      - `has_more` boolean, required: Whether at least one more page follows this one. Keep incrementing `page[number]` while this is `true`.

## Other responses

- `400`: `filter[type]` is missing or unsupported, `filter[kind]` is not one of the listed values, or a filter key is unknown.
- `401`: The access token is missing, expired or invalid.
- `403`: The account cannot see documents, either through its plan or its role permissions.
- `429`: Rate limit exceeded. Wait at least `Retry-After` seconds before trying again.

---

[API](https://skmtc.dev/hellobonsai/apis/bonsai-api.md) - [All operations](https://skmtc.dev/hellobonsai/apis/bonsai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/hellobonsai/apis/bonsai-api/revisions/abf12ed6a8d3?raw)
