---
title: "Partially update a template"
method: PATCH
path: "/v1/projectId/{projectId}/templates/{id}"
tags: ["Templates"]
---

# Partially update a template

`PATCH /v1/projectId/{projectId}/templates/{id}`

## Request

- Base URL: `https://api.bluefox.email`
- URL: `https://api.bluefox.email/v1/projectId/{projectId}/templates/{id}`
- Auth: HTTP bearer

Merges the given fields into the existing document - omitted fields are left unchanged. Nothing is required (unlike create) since every field is optional on a partial update.

## Path parameters

- `projectId` string, required
- `id` string, required

## Request body

- TemplateInputPatch
  - `name` string
  - `subject` string
  - `previewText` string: On PATCH, pass an empty string to clear it.
  - `document` unknown
  - `tags` string[]
  - `onProjectCreation` 'do-nothing' | 'set-as-transactional' | 'set-as-triggered' | 'set-as-campaign'

## Response `200`

OK

- object
  - `status` integer
  - `result` Template
    - `_id` string
    - `name` string
    - `subject` string
    - `previewText` string
    - `tags` string[]
    - `onProjectCreation` 'do-nothing' | 'set-as-transactional' | 'set-as-triggered' | 'set-as-campaign'
    - `usedVariables` string[]
    - `usedComponents` string[]
    - `createdAt` string, date-time
    - `updatedAt` string, date-time

## Other responses

- `400`: Invalid request body or query - every violation found (missing/invalid/unexpected fields) is reported in one response, semicolon-separated, not just the first one hit.
- `403`: Missing or invalid API key
- `404`: Templates not found

---

[API](https://skmtc.dev/bluefox/apis/bluefox-email-public-api.md) · [All operations](https://skmtc.dev/bluefox/apis/bluefox-email-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bluefox/apis/bluefox-email-public-api/revisions/fa1a0a835c7f?raw)
