> ## Documentation Index
> Fetch the complete documentation index at: https://docs.voyantcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Communication Template

> Update a template’s name or status.

## Method

`PATCH` `/v1/comms/templates/:id`

## Path Parameters

<ParamField path="id" type="uuid" required>Template ID.</ParamField>

## Body Parameters

<ParamField name="name" type="string">New name for the template.</ParamField>
<ParamField name="status" type="string">Updated status (`draft`, `active`, `inactive`, or `archived`).</ParamField>

## Headers

<ParamField header="Authorization" type="string">Bearer token (requires `comms:write`).</ParamField>
<ParamField header="content-type" type="string">`application/json`</ParamField>

## Request Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X PATCH "https://api.voyantcloud.com/v1/comms/templates/tmpl_01J0CBFPXW7SP2N8A9Q7T2048Q" \
    -H "Authorization: Bearer $VOYANT_API_KEY" \
    -H "content-type: application/json" \
    -d '{
      "name": "Booking Confirmation (Updated)",
      "status": "active"
    }'
  ```

  ```javascript Node.js theme={null}
  await fetch("https://api.voyantcloud.com/v1/comms/templates/tmpl_01J0CBFPXW7SP2N8A9Q7T2048Q", {
    method: "PATCH",
    headers: {
      Authorization: `Bearer ${process.env.VOYANT_API_KEY}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({ status: "inactive" }),
  })
  ```

  ```python Python theme={null}
  import os, requests

  payload = {"name": "WhatsApp Campaign Q2"}

  requests.patch(
    "https://api.voyantcloud.com/v1/comms/templates/tmpl_01J0CBFPXW7SP2N8A9Q7T2048Q",
    headers={
      "Authorization": f"Bearer {os.environ['VOYANT_API_KEY']}",
      "content-type": "application/json",
    },
    json=payload,
  )
  ```
</RequestExample>

## Response Example

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "id": "tmpl_01J0CBFPXW7SP2N8A9Q7T2048Q",
    "workspace_id": "ws_01HZYPM2QF2R8X9SZQ0J9SYBCN",
    "name": "Booking Confirmation (Updated)",
    "key": "booking_confirmation",
    "channel": "email",
    "purpose": "transactional",
    "status": "active",
    "created_at": "2025-01-08T10:22:31.000Z",
    "updated_at": "2025-02-10T09:18:04.000Z"
  }
  ```

  ```json 400 Bad Request theme={null}
  { "error": "No updates provided" }
  ```
</ResponseExample>

<Tip>
  At least one field (`name` or `status`) must be supplied; otherwise the API returns `400` with `"No updates provided"`.
</Tip>
