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

# Upsert multiple templates

`POST /v1/templates/upsert`

Create or update multiple notification templates in a single request. Templates define the content and format of notifications sent for delivery events.

## 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.net/usenash/apis/nash-api.md) · [All operations](https://skmtc.net/usenash/apis/nash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/usenash/nash-api/revisions/09a23a95889b/schema)
