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

# template.created

> Emitted when a template is created.

## Event Properties

| Field          | Value                |
| -------------- | -------------------- |
| `event`        | `"template.created"` |
| `confidential` | `boolean`            |
| `payload`      | `object`             |

<Tabs>
  <Tab title="Public Payload">
    | Field                    | Type                                  | Description                                                                        |
    | ------------------------ | ------------------------------------- | ---------------------------------------------------------------------------------- |
    | `title`                  | `string`                              | Name given to the new template                                                     |
    | `language`               | `string`                              | Language the template is written in                                                |
    | `numSections`            | `number`                              | Count of sections in the template                                                  |
    | `templateType`           | `"legacy" \| "personal" \| undefined` | Type of template: "legacy" for custom templates, "personal" for personal templates |
    | `source`                 | `"template_assembler" \| undefined`   | Source of creation                                                                 |
    | `reusedSectionCount`     | `number \| undefined`                 | Number of sections reused unchanged by reference                                   |
    | `customisedSectionCount` | `number \| undefined`                 | Number of sections created with customizations                                     |

    #### Example

    ```json theme={null}
    {
      "event": "template.created",
      "confidential": false,
      "payload": {
        "title": "SOAP",
        "language": "en",
        "numSections": 6
      }
    }
    ```
  </Tab>

  <Tab title="Confidential Payload">
    | Field         | Type                     | Description                                |
    | ------------- | ------------------------ | ------------------------------------------ |
    | `title`       | `string`                 | Name given to the new template             |
    | `language`    | `string`                 | Language the template is written in        |
    | `numSections` | `number`                 | Count of sections in the template          |
    | `template`    | `TemplateCreatedPayload` | Complete template object with all sections |

    <Accordion title="template object properties">
      | Field      | Type        | Description |
      | ---------- | ----------- | ----------- |
      | `id`       | `string`    | -           |
      | `name`     | `string`    | -           |
      | `language` | `string`    | -           |
      | `sections` | `Section[]` | -           |

      **Section properties:**

      | Field   | Type     | Description |
      | ------- | -------- | ----------- |
      | `id`    | `string` | -           |
      | `title` | `string` | -           |
    </Accordion>

    #### Example

    ```json theme={null}
    {
      "event": "template.created",
      "confidential": true,
      "payload": {
        "title": "SOAP",
        "language": "en",
        "numSections": 6,
        "template": {
          "id": "template_1",
          "name": "SOAP",
          "language": "en",
          "sections": [
            {
              "id": "section_1",
              "title": "HPI"
            }
          ]
        }
      }
    }
    ```
  </Tab>
</Tabs>
