# save_template

Source: https://heyeveryone.ai/docs/mcp/save_template

> Create or edit a recurring content format. Without `templateId` it creates one: `name` and `titlePattern` are required, plus the original draft (`masterText`), optional `campaignLabels`, and `channels`: the channel accounts (list_channel_accounts) to create a draft post for, each with an optional `format` and optional `segments` (its own text, several for a thread; left out: start from the original draft). With `templateId` it changes only the fields you send (`description: null` clears it); `channels`, when sent, replaces the whole list. Content already created from it doesn't change. Placeholders are written `{name}` (a letter first; letters, digits, spaces, `_` or `-`), for example `{product}` or `{episode number}`; the template's `placeholders` lists them, and create_content_from_template fills them from `values`. Names are unique in the workspace (`name_taken`). A template only creates drafts; nothing is scheduled or published from it.

Create or edit a recurring content format. Without `templateId` it creates one: `name` and `titlePattern` are required, plus the original draft (`masterText`), optional `campaignLabels`, and `channels`: the channel accounts (list_channel_accounts) to create a draft post for, each with an optional `format` and optional `segments` (its own text, several for a thread; left out: start from the original draft). With `templateId` it changes only the fields you send (`description: null` clears it); `channels`, when sent, replaces the whole list. Content already created from it doesn't change. Placeholders are written `{name}` (a letter first; letters, digits, spaces, `_` or `-`), for example `{product}` or `{episode number}`; the template's `placeholders` lists them, and create_content_from_template fills them from `values`. Names are unique in the workspace (`name_taken`). A template only creates drafts; nothing is scheduled or published from it.

## Access and cost

- Kind: mutation
- Scope: workspace
- Actors: member, agent
- Credits: Free
- Requires confirmation: false
- Accepts idempotency key: false

## Input schema

```json
{
  "properties": {
    "workspaceId": {
      "format": "uuid",
      "type": "string"
    },
    "templateId": {
      "format": "uuid",
      "type": "string"
    },
    "name": {
      "maxLength": 120,
      "minLength": 1,
      "type": "string"
    },
    "description": {
      "anyOf": [
        {
          "maxLength": 500,
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "titlePattern": {
      "maxLength": 300,
      "minLength": 1,
      "type": "string"
    },
    "masterText": {
      "type": "string"
    },
    "campaignLabels": {
      "items": {
        "maxLength": 60,
        "minLength": 1,
        "type": "string"
      },
      "maxItems": 10,
      "type": "array"
    },
    "channels": {
      "items": {
        "properties": {
          "channelAccountId": {
            "format": "uuid",
            "type": "string"
          },
          "format": {
            "anyOf": [
              {
                "pattern": "^[a-z][a-z0-9_]*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "segments": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "maxItems": 25,
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "channelAccountId"
        ],
        "type": "object"
      },
      "maxItems": 20,
      "type": "array"
    }
  },
  "required": [
    "workspaceId"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "additionalProperties": false,
  "properties": {
    "template": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "format": "uuid",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": [
            "string",
            "null"
          ]
        },
        "titlePattern": {
          "type": "string"
        },
        "masterText": {
          "type": "string"
        },
        "campaignLabels": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "channels": {
          "items": {
            "additionalProperties": false,
            "properties": {
              "channelAccountId": {
                "format": "uuid",
                "type": "string"
              },
              "platform": {
                "enum": [
                  "x",
                  "linkedin",
                  "threads",
                  "bluesky",
                  "instagram",
                  "facebook",
                  "tiktok",
                  "youtube",
                  "sandbox"
                ],
                "type": "string"
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "displayName": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "status": {
                "enum": [
                  "active",
                  "reconnect_required",
                  "disconnected"
                ],
                "type": "string"
              },
              "format": {
                "anyOf": [
                  {
                    "pattern": "^[a-z][a-z0-9_]*$",
                    "type": "string"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "segments": {
                "anyOf": [
                  {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "channelAccountId",
              "platform",
              "handle",
              "displayName",
              "status",
              "format",
              "segments"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "placeholders": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "createdAt": {
          "format": "date-time",
          "type": "string"
        },
        "updatedAt": {
          "format": "date-time",
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "description",
        "titlePattern",
        "masterText",
        "campaignLabels",
        "channels",
        "placeholders",
        "createdAt",
        "updatedAt"
      ],
      "type": "object"
    },
    "created": {
      "type": "boolean"
    }
  },
  "required": [
    "template",
    "created"
  ],
  "type": "object"
}
```

## Errors

```json
[
  "name_taken",
  "limit_reached"
]
```

## Annotations

```json
{
  "destructiveHint": false,
  "idempotentHint": false,
  "openWorldHint": false,
  "readOnlyHint": false,
  "title": "Save a template"
}
```
