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

# Update DM Template

> Update an existing DM template

Updates an existing DM template. Both fields are required.

### Headers

| Header          | Required | Description                     |
| --------------- | -------- | ------------------------------- |
| `Authorization` | Yes      | `Bearer ctgo_your_api_key_here` |
| `Content-Type`  | Yes      | `application/json`              |

### Path parameters

| Parameter | Type    | Description     |
| --------- | ------- | --------------- |
| `id`      | integer | The template ID |

### Body

| Field         | Type   | Required | Description                                       |
| ------------- | ------ | -------- | ------------------------------------------------- |
| `name`        | string | Yes      | Template name (1-100 characters). Must be unique. |
| `messageBody` | string | Yes      | Message content (1-2000 characters)               |

### Example

```bash theme={null}
curl -X PUT https://www.catchthegoodones.com/api/v2/dm-templates/1 \
  -H "Authorization: Bearer ctgo_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name": "Updated intro", "messageBody": "Hey! Thanks for following. Let me know if you have any questions."}'
```

### Response

<ResponseExample>
  ```json 200 theme={null}
  {
    "template": {
      "id": 1,
      "name": "Updated intro",
      "messageBody": "Hey! Thanks for following. Let me know if you have any questions.",
      "createdAt": "2026-04-10T12:00:00.000Z",
      "updatedAt": "2026-04-17T12:00:00.000Z"
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Template not found"
  }
  ```

  ```json 409 theme={null}
  {
    "error": "You already have a template called 'Updated intro'"
  }
  ```
</ResponseExample>
