---
title: "Assign a template to a Workspace sheet"
method: PUT
path: "/v1/sheets/{sheet_id}/template"
tags: ["Workspace Sheets"]
---

# Assign a template to a Workspace sheet

`PUT /v1/sheets/{sheet_id}/template`

Assign or unassign a template for a Workspace sheet. Pass `template_key: null` to unassign the current template.

Set `auto_set_header_row` to `true` to automatically detect and set the header row before applying the template. If the sheet's headers are already set, `auto_set_header_row` is ignored.

## Request body

- SheetTemplateAssignmentRequest
  - `template_key` string, nullable, required — The unique key of the template to assign to the sheet. Pass `null` to unassign the current template.
  - `auto_set_header_row` boolean — Whether to automatically detect and set the header row before applying the template. Ignored if the sheet's headers are already set.

## Response `200`

The request has succeeded.

- WorkspaceSheet
  - `id` integer, required — The unique identifier of the sheet.
  - `workspace_id` integer, required — The ID of the Workspace that contains the sheet.
  - `name` string, required — The name of the sheet.
  - `template_key` string, nullable — The unique key of the template assigned to the sheet, if any.
  - `custom_metadata` object, nullable — Custom metadata associated with the sheet.
  - `columns` WorkspaceSheetColumn[] — The columns of the sheet, included when the sheet's headers have been set.
    - `id` integer, required — The unique identifier of the column.
    - `name` string, required — The label of the column.
    - `template_column_key` string, nullable — The key of the template column this sheet column is mapped to, if any.
    - `is_custom` boolean — Whether the column is a custom column not present in the assigned template.

## Other responses

- `400` — 400

---

[API](https://skmtc.net/oneschema/apis/templates.md) · [All operations](https://skmtc.net/oneschema/apis/templates/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/oneschema/templates/revisions/40674aa6d4d9/schema)
