Skip to content

Template Created (templates.created)

Description

This event is triggered when a new template is created in the system. This allows users and external systems to be notified of the availability of new templates.

Trigger Conditions

This webhook is triggered when a new template is created in the system.

Purpose

Alerts external systems to the creation of a new template, enabling synchronization or updates in template management services.

Use Case

  • Synchronize newly created templates across connected systems.
  • Notify users or admins about the availability of a new template.
  • Facilitate better template management by ensuring access to the latest designs.

Example Payload

{
  "event": "templates.created",
  "data": {
    "id": "22",
    "title": "Invoice Template",
    "templateUrl": "http://api.openletterconnect.com/api/v1/download/s3/openletterconnect/org-1/user-3/templates/upload/html/1702895166930-template.json",
    "backTemplateUrl": "http://api.openletterconnect.com/api/v1/download/s3/openletterconnect/org-2/user-3/templates/upload/backHtml/1702379710452-back-template.json",
    "thumbnailUrl": "http://api.openletterconnect.com/api/v1/download/s3/openletterconnect/org-1/user-1/templates/upload/thumbnail/1701775937282-logo.png",
    "metaData": {
      "account_id": "123-1234-12342355-12323534634"
    },
    "templatePath": "s3/openletterconnect/org-1/user-3/templates/upload/html/1702895166930-template.json",
    "backTemplatePath": "s3/openletterconnect/org-1/user-3/templates/upload/html/1702895166930-template.json",
    "thumbnailPath": "s3/openletterconnect/org-1/user-3/templates/upload/html/1702895166930-template.png",
    "backThumbnailPath": "s3/openletterconnect/org-1/user-3/templates/upload/html/1702895166930-template.png",
    "productId": 1,
    "envelopeType": null,
    "fields": [],
    "createdAt": "2024-01-10T15:06:29.204Z",
    "updatedAt": "2024-01-10T15:06:29.204Z"
  },
  "token": "YOUR_WEBHOOK_SECRET_KEY"
}

Parameters

  • event (String): The type of event that triggered the webhook.
  • data (Object): Contains information about the created template.

    • id (String): Unique identifier for the template.
    • title (String): The title of the template, providing a descriptive name for easy identification.
    • templateUrl (String): URL for accessing the HTML version of the template.
    • backTemplateUrl (String): URL for accessing the back version of the template.
    • thumbnailUrl (String): URL for the thumbnail image representing the template.
    • metaData (Object): Metadata associated with the template, containing additional details relevant to its usage.
    • account_id (String): Unique identifier for the account associated with this template.
    • templatePath (String): Storage path for the HTML file of the template in an S3 bucket or similar storage system.
    • backTemplatePath (String): Storage path for the back version of the template in an S3 bucket or similar storage system.
    • thumbnailPath (String): Storage path for the thumbnail image in an S3 bucket or similar storage system.
    • backThumbnailPath (String): Storage path for a thumbnail image of the back version of the template in an S3 bucket or similar storage system.
    • productId (Integer): Identifier for the product associated with this template.
    • envelopeType (String or null):Type of envelope associated with this template, if applicable. If not relevant, it may be set to null.
    • fields (Array):An array that can hold various dynamic fields related to this template. Currently empty, indicating no dynamic fields are defined.
    • createdAt (Timestamp): Date and time when the order was created.
    • updatedAt (Timestamp): Date and time when the order was last updated.
  • token (String): Your secret webhook token.

Conclusion

The templates.created webhook provides vital information about new templates being created within Open Letter Connect, allowing external systems to respond effectively. By following best practices regarding security, error handling, and testing, you can ensure a smooth integration experience.