---
updatedAt: 2026-07-10T13:44:52.000Z
agentTools:
  projectIndex: https://docs.oneschema.co/llms.txt
---

# Assign a template to a Workspace sheet

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.


# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "Workspaces",
    "version": "1",
    "description": "An API for managing OneSchema Workspaces and Workspace sheets.",
    "contact": {
      "name": "OneSchema Support",
      "email": "support@oneschema.co"
    },
    "license": {
      "name": "proprietary",
      "url": "https://www.oneschema.co/terms-and-conditions"
    },
    "termsOfService": "https://www.oneschema.co/terms-and-conditions"
  },
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.oneschema.co",
      "description": "Production server (hosted in the US)"
    },
    {
      "url": "https://api.eu.oneschema.co",
      "description": "Production server (hosted in the EU)"
    },
    {
      "url": "https://api.ca.oneschema.co",
      "description": "Production server (hosted in Canada)"
    },
    {
      "url": "https://api.au.oneschema.co",
      "description": "Production server (hosted in Australia)"
    }
  ],
  "tags": [
    {
      "name": "Workspace Sheets",
      "description": "Sheet operations within Workspaces"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-KEY"
      }
    },
    "schemas": {
      "WorkspaceSheet": {
        "type": "object",
        "required": [
          "id",
          "workspace_id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32",
            "description": "The unique identifier of the sheet."
          },
          "workspace_id": {
            "type": "integer",
            "format": "int32",
            "description": "The ID of the Workspace that contains the sheet."
          },
          "name": {
            "type": "string",
            "description": "The name of the sheet."
          },
          "template_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique key of the template assigned to the sheet, if any."
          },
          "custom_metadata": {
            "type": [
              "object",
              "null"
            ],
            "description": "Custom metadata associated with the sheet."
          },
          "columns": {
            "type": "array",
            "description": "The columns of the sheet, included when the sheet's headers have been set.",
            "items": {
              "$ref": "#/components/schemas/WorkspaceSheetColumn"
            }
          }
        }
      },
      "WorkspaceSheetColumn": {
        "type": "object",
        "required": [
          "id",
          "name"
        ],
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32",
            "description": "The unique identifier of the column."
          },
          "name": {
            "type": "string",
            "description": "The label of the column."
          },
          "template_column_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The key of the template column this sheet column is mapped to, if any."
          },
          "is_custom": {
            "type": "boolean",
            "description": "Whether the column is a custom column not present in the assigned template."
          }
        }
      },
      "SheetTemplateAssignmentRequest": {
        "type": "object",
        "required": [
          "template_key"
        ],
        "properties": {
          "template_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The unique key of the template to assign to the sheet. Pass `null` to unassign the current template."
          },
          "auto_set_header_row": {
            "type": "boolean",
            "description": "Whether to automatically detect and set the header row before applying the template. Ignored if the sheet's headers are already set."
          }
        }
      }
    }
  },
  "paths": {
    "/v1/sheets/{sheet_id}/template": {
      "parameters": [
        {
          "name": "sheet_id",
          "in": "path",
          "required": true,
          "description": "The id of the sheet.",
          "schema": {
            "type": "integer",
            "format": "int32"
          }
        }
      ],
      "put": {
        "operationId": "assign-sheet-template",
        "summary": "Assign a template to a Workspace sheet",
        "description": "Assign or unassign a template for a Workspace sheet. Pass `template_key: null` to unassign the current template.\n\nSet `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.\n",
        "tags": [
          "Workspace Sheets"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SheetTemplateAssignmentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The request has succeeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WorkspaceSheet"
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}
```