---
title: "Templates"
description: "Lytics Templates are used with the Lytics Webhook Export workflow provide a powerful interface for users to create bespoke, real time integrations with…"
url: "https://www.contentstack.com/docs/lytics/templates-1"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-11-05"
---

# Templates

## Overview

Lytics Templates, used with the Lytics Webhook Export workflow, let you build bespoke, real-time integrations with any third-party API. A template defines the payload and profile data that each request carries. You can create templates in the UI or through the Lytics API, in [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript), [Jsonnet](https://jsonnet.org/), or [Handlebars.js](https://handlebarsjs.com/). Once created, a template can be selected in a Webhook Export, which runs it against the outgoing payload of each request.

## Template Languages

Language

API type value

Description

**JavaScript**

js1

Define a function named template that takes the profile as its data argument and returns the payload. A helper library for hashing, segment events, and job configuration is built in. See [Creating JavaScript Templates](/docs/lytics/creating-javascript-templates) and [Using the JavaScript Library](/docs/lytics/using-the-javascript-library).

**Jsonnet**

jsonnet

A data-templating language for generating JSON. Import the lytemplates.libsonnet library and read profile fields with event.get(). See [Using the Jsonnet Library](/docs/lytics/using-the-jsonnet-library).

**Handlebars.js**

handlebars

String templates in [Handlebars.js](https://handlebarsjs.com/) syntax.

In the UI, choose the language from **Template Language** in the creation wizard. Through the API, pass the API type value when you create the template (see [Creating Templates using the API](/docs/lytics/api-created-templates)).

## Viewing Templates

Templates are in the Lytics UI under **Data Pipeline > Templates**. The Templates page lists all the templates in an account, along with a button for creating a new one.

## Creating Templates

How you create a template depends on whether you use the UI or the API. Start with one of the following guides:

1.  [Creating Templates in the UI](/docs/lytics/ui-templates)
2.  [Creating Templates using the API](/docs/lytics/api-created-templates)
3.  [Creating JavaScript Templates](/docs/lytics/creating-javascript-templates)
4.  [Using the Jsonnet Library](/docs/lytics/using-the-jsonnet-library)
5.  [Using the JavaScript Library](/docs/lytics/using-the-javascript-library)
6.  [Template Examples](/docs/lytics/template-examples)

For a complete walkthrough with a real destination, see [Insider Webhook Templates](/docs/lytics/insider-webhook-templates).

## Activating Templates

To activate a template, create a Webhook job: go to **Data Pipeline > Jobs**, click **\+ Create New**, and select the **Webhooks** provider. See [Webhooks](/docs/lytics/webhooks) for full instructions on configuring outgoing webhooks. From the **Lytics Template** dropdown menu, select the template to run against each outgoing request. The template's output becomes the request body.

## Using Templates

Once you have created your first Template, you can find it in the Template List view, and click on it to access the individual Template. From this view, you can create Webhooks to export users or events using your Template by clicking on the **\+ Create New** button. This view will show all of the Webhooks associated with your Template.