Template Manager
Retrieve and manage message templates at the location level for SMS, email, and workflow messaging with variable substitution support.
The Template Manager gives you programmatic access to message templates stored at the location level. These templates power SMS messages, emails, and workflow actions across the sub-account, with variable substitution for personalized communication at scale.
What This MCP Tool Does
This tool lets you retrieve all templates configured in a sub-account and delete templates you no longer need. Templates in GHL are reusable message blocks with placeholder variables that get replaced with contact-specific data at send time. Managing them through the API means you can audit, clean up, and organize templates across multiple sub-accounts without clicking through each one manually.
Endpoint Reference
List all templates:
GET /locations/{locationId}/templates
Returns all message templates for the sub-account including template content, variable placeholders, and metadata.
Delete a template:
DELETE /locations/{locationId}/templates/{templateId}
Permanently removes a template from the sub-account. Any workflows referencing this template will break, so verify usage before deleting.
Authentication
Requires a Private Integration Token (PIT) with the locations scope enabled. Templates are location-level resources, so the PIT must have access to the specific sub-account.
Key Parameters
When listing templates, the response includes:
id— unique template identifiername— display name of the templatebody— template content with variable placeholderstype— template category (SMS, email, etc.)
Variable placeholders follow the GHL custom values format using double curly braces. For example, {{contact.first_name}} gets replaced with the contact’s first name at send time.
Important Notes
Template creation and updates are typically done through the GHL UI or via the broader location configuration tools. The API currently focuses on retrieval and deletion.
Before deleting a template, check whether it is referenced in any active workflows. The API does not validate dependencies, so deleting a template that is in use will cause workflow actions to fail silently.
Templates are scoped to individual locations. If you need the same template across multiple sub-accounts, you need to create it in each one or use snapshots to replicate configurations.
Common Questions
Can I create new templates through the API? Template creation through the MCP server is limited. For full template management including creation and editing, use the GHL UI or the snapshot system. The API is best suited for auditing and cleanup operations.
How do I find which workflows use a specific template? The template API does not include dependency tracking. You would need to use the Workflow Lister to retrieve workflows and inspect their action configurations for template references.
Can I copy templates between locations? Not directly through this endpoint. The recommended approach is to read the template content from one location and recreate it in another, or use GHL snapshots which include templates as part of the package.
Related MCP Tools
- Location CRUD — Manage the sub-account where templates live
- Location Custom Values — Manage the custom values that templates reference
- SMS Operations — Send messages using templates
- Email Send — Send emails using templates