# updateContentTemplate

Update a template by id (name, body, subject). The id is nested in the input object.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "updateContentTemplate", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `input`: `UpdateContentTemplateInput!` (required)
  - `id`: `ID!` (required)
  - `input`: `ContentTemplateMutationInput!` (required)
    - `name`: `String!` (required)
    - `bodyContent`: `String!` (required)
    - `bodyFormat`: `String`
    - `subjectContent`: `String`
    - `attachments`: `[ContentTemplateAttachmentInput!]`
      - `uploadedFileId`: `ID!` (required)
      - `fileName`: `String!` (required)
      - `contentType`: `String!` (required)
      - `fileSize`: `Int!` (required)
      - `page`: `ContentTemplateAttachmentPageInput`
        - `itemId`: `ID!` (required)
        - `versionNumber`: `Int!` (required)
        - `sendsLatestAs`: `ID`
    - `taskConfig`: `TaskTemplateConfigInput`. Structured config for a TASK content template. The template's `bodyContent` holds the task description and `name` is the template label; everything else task-shaped lives here. Assignee is intentionally absent: an applied task template is always assigned to the acting user at apply time.
      - `title`: `String!` (required). Task title. Rendered with merge fields + spintax against the contact at apply time.
      - `taskType`: `String`. Free-text subtype label (maps to `Task.taskType`).
      - `dueOffset`: `TaskTemplateRelativeDateOffsetInput!` (required). Due date as a relative offset from apply time.
        - `amount`: `Int!` (required)
        - `unit`: `TaskTemplateRelativeTimeUnit!` (required, one of `DAYS`, `WEEKS`, `MONTHS`)
      - `preferredTimeOfDay`: `TaskTemplateTimeOfDayInput!` (required). Time-of-day the resolved due date snaps to.
        - `hour`: `Int!` (required)
        - `minute`: `Int!` (required)
        - `timezone`: `Timezone!` (required, one of `IDLW`, `SST`, `HST`, `AKST`, `PST`, `MST`, `AZ`, `CST`, `EST`, `AST`, `BRT`, `FNT`, `AZOT`, `UTC`, `CET`, `EET`, `MSK`, `GST`, `PKT`, `BST`, `ICT`, `JST`, `AEST`, `NCT`, `NZST`). AZ: Arizona: MST all year, no DST.
      - `autoCompleteOnNoteAdded`: `Boolean`
      - `autoCompleteOnReassignment`: `Boolean`
    - `taskSetSteps`: `[TaskSetStepInput!]`. One step of a TASK_SET template. `taskTemplateId` must name a TASK template in the caller's organization: a TASK_SET is rejected (a set cannot contain a set). The same template may appear more than once. The timing here WINS over the referenced template's own `taskConfig` timing.
      - `taskTemplateId`: `ID!` (required)
      - `dueOffset`: `TaskTemplateRelativeDateOffsetInput!` (required)
        - `amount`: `Int!` (required)
        - `unit`: `TaskTemplateRelativeTimeUnit!` (required, one of `DAYS`, `WEEKS`, `MONTHS`)
      - `preferredTimeOfDay`: `TaskTemplateTimeOfDayInput!` (required)
        - `hour`: `Int!` (required)
        - `minute`: `Int!` (required)
        - `timezone`: `Timezone!` (required, one of `IDLW`, `SST`, `HST`, `AKST`, `PST`, `MST`, `AZ`, `CST`, `EST`, `AST`, `BRT`, `FNT`, `AZOT`, `UTC`, `CET`, `EET`, `MSK`, `GST`, `PKT`, `BST`, `ICT`, `JST`, `AEST`, `NCT`, `NZST`). AZ: Arizona: MST all year, no DST.

## Response (data, an example)

```json
{
  "workflowAutomationsMutation": {
    "updateContentTemplate": {
      "id": "<ID>",
      "name": "…",
      "type": "EMAIL",
      "updatedAt": "2026-01-01T00:00:00.000Z",
      "taskSetSteps": [
        {
          "id": "<ID>",
          "taskTemplate": {
            "id": "<ID>",
            "name": "…"
          },
          "dueOffset": {
            "amount": 0,
            "unit": "DAYS"
          },
          "preferredTimeOfDay": {
            "hour": 0,
            "minute": 0,
            "timezone": "IDLW"
          }
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "updateContentTemplate",
    "variables": {
      "input": {
        "id": "<id>",
        "input": {
          "name": "<String>",
          "bodyContent": "<String>"
        }
      }
    }
  }'
```
