Hooks is a webhook application used for connecting applications together. It is an event based system that has a number of triggers or listeners. You can access the Hooks system under Automation > Hooks. Some typical use cases for Hooks include

  • Connect forms to your CRM. When a new user fills out a form, they are added to a CRM.
  • Page cache updates. In the case you use an external page cache, you can be notified of a page edit, and you can send that page contents to your caching engine. 
  • Share information with Slack. Based on an action you can seamlessly connect this to a Slack channel via a REST API. 
  • Compliance. Notify your compliance team when a webpage has changed. 

Each Hook must be given a Name, an Entity and a Method. 

Entities

Hooks listeners are currently available on the following entities or modules: 

  • Blogs
    • Blog
    • Post
    • Comment
  • Books
    • Book
    • Unit
    • Page
  • Common
    • Category
    • Custom Field
    • Global Component
    • Tag
    • Widget
  • Documentation 
    • Page
    • Comment 
    • Comment Vote
  • Files
    • File 
    • File comment
    • File share 
    • Folder 
    • Folder comment
    • Image
  • Hooks
    • Hook
  • Mailer
    • Batch
  • Menus
    • Menu
    • Menu Element
  • Pages
    • Page
  • Products
    • Product
    • Product Variant
    • Product Description
    • Category
    • Category Description
  • Rewrites
    • Rewrite
  • Scheduler
    • Task
  • Sites
    • Client
    • Site
    • Environment
    • Hostname
  • Users
    • Person
    • Group
    • User

Methods

Based on these entities you are able to apply a listener to certain methods. These currently are 

  1. Created 
  2. Updated 
  3. Deleted

For example, you can have a listener waiting for changes to a Page, in this case, you would create a Hook for the Page entity and the method would be Updated. Based on this listener you can then take one or more actions. 

Actions

Current actions supported:

  1. Create File
  2. Send Email
  3. HTTP Request
  4. AI Agent: Invoke an installed AI agent that reads tenant data through its allowed tools and records its decision.

These actions are performed in the order they are listed in. 

Create File 

You can create a file based on a template located in templates /hooks/ folder.

Output file: This will create a file in folder /hooks/{hookName}/{batchId}/{actionId}. If no file name specified, the action-{actionId} will be used as filename.

Send Email

You can send an email based on a template located in templates/hooks/ folder.

You can specify the following details:  

  • From email address 
  • From name
  • To email address
  • To name
  • Email subject 
  • Description 

AI Agent

Runs one of your installed AI agents against the triggering record and records what it decided. Install and configure agents under Agents ▸ Library; see AI Agents.

Two fields:

  • Agent install: the installed agent to invoke.
  • Agent input: composes the message the agent receives. Use template code to include data from the triggering event or from previous actions. Leave it empty to send a generic instruction.

The agent input is worth spending time on. An agent given only a record id has to go and find its context through tool calls, which costs more and can hit the iteration cap; an agent handed the relevant fields directly usually answers in one pass.

Two constraints

  • Asynchronous hooks only. The action is not offered on a synchronous hook. Agent runs take far too long to sit inside a request.
  • Not inside a loop. The action cannot be placed in a loop element. To run an agent over many records, trigger it per record with an entity event rather than looping.