---
title: "Upsert multiple templates"
method: POST
path: "/v1/templates/upsert"
tags: ["Templates"]
---

# Upsert multiple templates

`POST /v1/templates/upsert`

## Request

- Base URL: `https://api.sandbox.usenash.com`
- URL: `https://api.sandbox.usenash.com/v1/templates/upsert`
- Auth: none declared

Create or update multiple delivery window or shift templates in a single request. Templates generate their instances on a recurring schedule. On update, a shift template's payload is merged: a field you omit keeps its stored value, and clearing one requires sending it explicitly as null. The external references are the exception, because they are resolved to internal ids only when supplied: sending externalStoreLocationId or externalZoneIds as null leaves the stored store location or zones unchanged.

## Request body

- CreateTemplatesInputSerializer: Expected payload for creating multiple templates.
  - `templates` CreateTemplateInputSerializer[], required
    - `type` string, required: Template type (e.g., DELIVERY_WINDOW)
    - `deliveryWindowTemplatePayload` object, nullable: Required for DELIVERY_WINDOW templates
    - `shiftTemplatePayload` object, nullable: Required for SHIFT templates
    - `externalId` string, nullable: External identifier for the template
    - `name` string, nullable: The name of the template.
    - `startDatetime` string, nullable: The start datetime of the template.
    - `endDatetime` string, nullable: The end datetime of the template.
    - `daysOfWeek` string[], nullable: Days of the week for template usage
    - `generationFrequencyValue` integer, nullable: How often to create instances (value)
    - `generationFrequencyUnit` string, nullable: How often to create instances (unit)
    - `createInstancesUpToValue` integer, nullable: How far into the future to create instances (value)
    - `createInstancesUpToUnit` string, nullable: How far into the future to create instances (unit)
    - `overrideExistingInstances` boolean, nullable: Whether to overwrite existing instances

## Response `200`

OK

- TemplatesResponse: Response for a list of templates.
  - `templates` TemplateOutput[], required
    - `id` string, required: The ID of the template.
    - `type` string, required: Template type (e.g., DELIVERY_WINDOW)
    - `payload` object, required: Required for templates
    - `externalId` string, required: External identifier for the template
    - `name` string, required: Name of the template
    - `startDatetime` string, required: The start datetime of the template.
    - `endDatetime` string, required: The end datetime of the template.
    - `daysOfWeek` string[], required: Days of the week for template usage
    - `generationFrequencyValue` integer, required: How often to create instances (value)
    - `generationFrequencyUnit` string, required: How often to create instances (unit)
    - `createInstancesUpToValue` integer, required: How far into the future to create instances (value)
    - `createInstancesUpToUnit` string, required: How far into the future to create instances (unit)
    - `overrideExistingInstances` boolean, required: Whether to overwrite existing instances

## Other responses

- `422`: Unprocessable Content

---

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