Is AI recommending you? Ask Contentstack Canoe for free
Is AI recommending your brand? Find out with Contentstack Canoe for free
Contentstack.comAcademyLogin
CS-log-dark.svgCS-log-dark.svg
  • Changelog
  • APIs
  • SDKs

Platform

  • Solution Center
  • Marketplace
  • Changelog
  • Developers & IT
  • Business users
  • Digital leaders
  • Developer Fast Track
  • Plans & Pricing

Solutions

  • Retail
  • Travel and tourism
  • Financial services
  • Technology
  • Manufacturing
  • E-commerce
  • Localization
  • Personalization
  • Portals and knowledge bases

Resources

  • Academy
  • Docs
  • Contentstack for Developers
  • Product updates
  • Contentstack on Contentstack
  • Blog
  • Insights and analyst reports
  • The Forrester Wave™: Digital Experience Platforms, Q4 2025
  • Webinars
  • Podcasts
  • Glossary
  • Content generative library
  • Community
  • Headless CMS
  • Composable AXP
  • Personalization
  • CDP

Customers

  • Case Studies
  • Customer Care
  • Contentstack Experience Awards
  • Customer support

Partners

  • Overview
  • Find a partner
  • Login

Company

  • About us
  • News
  • Customer support portal
  • Contact

Social

  • Facebook
  • LinkedIn
  • Instagram
  • GitHub
  • YouTube
  • Discord
  • X
LegalTermsPrivacyTrust Center

Cookie settings

Copyright © 2026 Contentstack Inc. All rights reserved.
/
  1. Home
  2. APIs
  3. Lytics API
  4. Templates

Templates

markdownView as Markdown

Create, manage, and test templates.

List templates

GEThttps://api.lytics.io/v2/template

undefined

Sample Response
Status|200 OK
12345678910111213141516171819202122232425
{
  "_meta": {},
  "data": [
    {
      "author_id": "string",
      "created": "string",
      "description": "string",
      "desired_format": "string",
      "field_filter": [
        "string"
      ],
      "id": "string",
      "lytics_managed": true,
      "name": "string",
      "reference_tables": [
        "string"
      ],
      "target": "string",
      "type": "string",
      "updated": "string"
    }
  ],
  "request_id": "string",
  "status": 0
}

Create a template

POSThttps://api.lytics.io/v2/template

undefined

Sample Request
1
"string"
Sample Response
Status|200 OK
1234567891011121314151617181920212223
{
  "_meta": {},
  "data": {
    "author_id": "string",
    "created": "string",
    "description": "string",
    "desired_format": "string",
    "field_filter": [
      "string"
    ],
    "id": "string",
    "lytics_managed": true,
    "name": "string",
    "reference_tables": [
      "string"
    ],
    "target": "string",
    "type": "string",
    "updated": "string"
  },
  "request_id": "string",
  "status": 0
}

Test a template

POSThttps://api.lytics.io/v2/template/test

undefined

Sample Request
12345678910111213141516
{
  "entity": {},
  "job_config": {},
  "reference_tables": [
    "string"
  ],
  "sample_segments": {
    "as": "env",
    "names": [
      "string"
    ]
  },
  "template_definition": "string",
  "template_target": "stream",
  "template_type": "jsonnet"
}
Sample Response
Status|200 OK
1
"string"

Get a template

GEThttps://api.lytics.io/v2/template/{id}

undefined

Sample Response
Status|200 OK
1234567891011121314151617181920212223
{
  "_meta": {},
  "data": {
    "author_id": "string",
    "created": "string",
    "description": "string",
    "desired_format": "string",
    "field_filter": [
      "string"
    ],
    "id": "string",
    "lytics_managed": true,
    "name": "string",
    "reference_tables": [
      "string"
    ],
    "target": "string",
    "type": "string",
    "updated": "string"
  },
  "request_id": "string",
  "status": 0
}

Update a template

POSThttps://api.lytics.io/v2/template/{id}

undefined

Sample Request
1
"string"
Sample Response
Status|200 OK
1234567891011121314151617181920212223
{
  "_meta": {},
  "data": {
    "author_id": "string",
    "created": "string",
    "description": "string",
    "desired_format": "string",
    "field_filter": [
      "string"
    ],
    "id": "string",
    "lytics_managed": true,
    "name": "string",
    "reference_tables": [
      "string"
    ],
    "target": "string",
    "type": "string",
    "updated": "string"
  },
  "request_id": "string",
  "status": 0
}

Delete template

DELETEhttps://api.lytics.io/v2/template/{id}

undefined

Sample Response
Status|200 OK
123456
{
  "_meta": {},
  "data": {},
  "request_id": "string",
  "status": 0
}

Get a template definition

GEThttps://api.lytics.io/v2/template/{id}/definition

undefined

Sample Response
Status|200 OK
123456
{
  "_meta": {},
  "data": "string",
  "request_id": "string",
  "status": 0
}

Test a template

POSThttps://api.lytics.io/v2/template/{id}/test

undefined

Sample Request
12345678910
{
  "entity": {},
  "job_config": {},
  "sample_segments": {
    "as": "env",
    "names": [
      "string"
    ]
  }
}
Sample Response
Status|200 OK
1
"string"
Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

namerequiredstring

The template name

descriptionoptionalstring

A description of the template

reference_tablesoptionalstring

Reference table slugs a js1 template may read via lytics.ref (max 5); sending the param empty clears them

typerequiredstring

The template type

Headers

Authorizationoptionalstring

Hide Parameters

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

entityoptionalobject
job_configoptionalobject
reference_tablesoptionalstring[]

ReferenceTables the adhoc template may read via lytics.ref; a saved template uses its own declaration.

sample_segmentsoptionalobject
sample_segments.asoptionalstring

where membership is surfaced to the template; omit for neither

One of: env, entity

sample_segments.namesoptionalstring[]

audience names the entity is in; sample slugs are approximated from these, not the stored slug

template_definitionoptionalstring

Adhoc template definition

template_targetoptionalstring

One of: stream, entql, enrich

template_typeoptionalstring

Adhoc template type

One of: jsonnet, handlebars, js1

Hide Parameters

URL Parameters

idrequiredstring

The template ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

The template id

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

namerequiredstring

The template name

descriptionoptionalstring

A description of the template

reference_tablesoptionalstring

Reference table slugs a js1 template may read via lytics.ref (max 5); sending the param empty clears them

typerequiredstring

The template type

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

The template ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

The template ID

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Hide Parameters

URL Parameters

idrequiredstring

The template id

Query Parameters

account_idoptionalstring

The account ID. Defaults to the user's default account.

Headers

Authorizationoptionalstring

Body Parameters

entityoptionalobject
job_configoptionalobject
sample_segmentsoptionalobject
sample_segments.asoptionalstring

where membership is surfaced to the template; omit for neither

One of: env, entity

sample_segments.namesoptionalstring[]

audience names the entity is in; sample slugs are approximated from these, not the stored slug