Skip to main content
POST
/
integrators
/
timeline
/
v3
/
{appId}
/
event-templates
Create an event template
curl --request POST \
  --url 'https://api.hubapi.com/integrators/timeline/v3/{appId}/event-templates?hapikey=' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "PetSpot Registration",
  "objectType": "contacts",
  "headerTemplate": "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})",
  "detailTemplate": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n  **{{question}}**: {{answer}}\n{{/each}}",
  "tokens": [
    {
      "name": "petName",
      "label": "Pet Name",
      "type": "string"
    },
    {
      "name": "petAge",
      "label": "Pet Age",
      "type": "number"
    },
    {
      "name": "petColor",
      "label": "Pet Color",
      "type": "enumeration",
      "options": [
        {
          "value": "white",
          "label": "White"
        },
        {
          "value": "black",
          "label": "Black"
        },
        {
          "value": "brown",
          "label": "Brown"
        },
        {
          "value": "other",
          "label": "Other"
        }
      ]
    }
  ]
}
'
{
  "id": "1001298",
  "objectType": "contacts",
  "createdAt": "2020-02-12T20:58:26Z",
  "updatedAt": "2020-02-12T20:58:26Z",
  "name": "PetSpot Registration",
  "headerTemplate": "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})",
  "detailTemplate": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n  **{{question}}**: {{answer}}\n{{/each}}",
  "tokens": [
    {
      "name": "petName",
      "type": "string",
      "createdAt": "2020-02-12T20:58:26Z",
      "updatedAt": "2020-02-12T20:58:26Z",
      "label": "Pet Name",
      "options": []
    },
    {
      "name": "petAge",
      "type": "number",
      "createdAt": "2020-02-12T20:58:26Z",
      "updatedAt": "2020-02-12T20:58:26Z",
      "label": "Pet Age",
      "options": []
    },
    {
      "name": "petColor",
      "type": "enumeration",
      "createdAt": "2020-02-12T20:58:26Z",
      "updatedAt": "2020-02-12T20:58:26Z",
      "label": "Pet Color",
      "options": [
        {
          "value": "white",
          "label": "White"
        },
        {
          "value": "black",
          "label": "Black"
        },
        {
          "value": "brown",
          "label": "Brown"
        },
        {
          "value": "other",
          "label": "Other"
        }
      ]
    }
  ]
}

Supported products

Requires one of the following products or higher.
Marketing HubMarketing Hub -Free
Sales HubSales Hub -Free
Service HubService Hub -Free
Content HubContent Hub -Free
Data HubData Hub -Free

Authorizations

hapikey
string
query
required

Path Parameters

appId
integer<int32>
required

The ID of the target app.

Body

application/json

The new event template definition.

State of the template definition being created.

name
string
required

The template name.

objectType
string
required

The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported.

tokens
object[]
required

A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.

detailTemplate
string

This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.

headerTemplate
string

This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.

Response

successful operation

The current state of the template definition.

id
string
required

The template ID.

name
string
required

The template name.

objectType
string
required

The type of CRM object this template is for. [Contacts, companies, tickets, and deals] are supported.

tokens
object[]
required

A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects.

createdAt
string<date-time>

The date and time that the Event Template was created, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.

detailTemplate
string

This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details.

headerTemplate
string

This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header.

updatedAt
string<date-time>

The date and time that the Event Template was last updated, as an ISO 8601 timestamp. Will be null if the template was created before Feb 18th, 2020.

Last modified on December 16, 2025