**Version: 202601**

# Update theme custom template

**PATCH** `/openapi/2026-01/themes/:theme_id/theme-templates/:template_id`

Update the bindings (products, collections) of an existing template. `relations` replaces the current bindings as a whole; an empty array or omitting it removes all bindings.

## Request

**Path Parameters**

- `theme_id` string (required)

  Theme ID this template belongs to
- `template_id` string (required)

  Theme template ID to update

**application/json**

**Body | Example**

**Body (required)**

- `type` string (required)

  Template type. One of `product`, `collection`, `product_coll`, `page`
- `relations` string[]

  The template's full binding list (product / collection IDs). It REPLACES the current bindings rather than being merged into them. An empty array — or omitting the field entirely — unbinds everything, so always resend the full list when you only mean to keep it
- `selected_all` int32

  Bind every object matching `front_query_params` instead of listing them in `relations`: 0 = no (default), 1 = yes. When 1, the object set comes from `front_query_params`
- `front_query_params` object

  Filter that defines the object set when `selected_all` = 1; ignored otherwise

  - `search_keyword` string

    Keyword the object set is filtered by; only used when `selected_all` = 1
  - `collection_id` string

    Collection the object set is filtered by; only used when `selected_all` = 1

```json
{
  "type": "string",
  "relations": [
    "string"
  ],
  "selected_all": 0,
  "front_query_params": {
    "search_keyword": "string",
    "collection_id": "string"
  }
}
```

## Responses

**200**

OK

**application/json**

**Schema | Example**

**Schema**

- `code` string

  error code
- `message` string

  error message
- `data` object

  - `` object

```json
{
  "code": "string",
  "message": "string",
  "data": {}
}
```
