Email Template CRUD Setup
Create, retrieve, update, and delete email templates for use in campaigns, workflows, and one-off sends. Templates store reusable HTML email designs with merge fields for personalization. This quick-start covers the full template lifecycle.
Prerequisites
Before making your first Email Template CRUD call, confirm you have:
- A GoHighLevel sub-account with the Email Marketing feature enabled
- Access to Settings > Integrations > Private Integrations in your sub-account
- A REST client such as Postman, Insomnia, or
curlin your terminal - Your sub-account’s
locationId(found in Settings > Business Profile) - Basic knowledge of HTML email structure (or a pre-built HTML template to upload)
Set Up Authentication
All Email Template CRUD endpoints require a Private Integration Token (PIT) with the marketing scope.
Navigate to Settings > Integrations > Private Integrations. Click Create New Integration, name it “Email Templates API,” and enable the marketing scope. Click Save and copy the generated token.
Pass this token in the Authorization header as a Bearer token. Set your base URL to https://services.leadconnectorhq.com. Include Content-Type: application/json and the Version: 2021-07-28 header.
Make Your First Call
Start by creating an email template. Send a POST request to /marketing/emails/templates:
POST /marketing/emails/templates
Authorization: Bearer {your-pit-token}
Content-Type: application/json
{
"locationId": "your-location-id",
"name": "Welcome Email",
"subject": "Welcome to {{company_name}}!",
"body": "<html><body><h1>Welcome, {{first_name}}!</h1><p>Thanks for joining us.</p></body></html>",
"preheader": "We're glad you're here"
}
Key fields: name identifies the template internally. subject supports merge fields like {{first_name}} and {{company_name}}. body contains the full HTML email content. preheader sets the preview text shown in email clients.
To list templates, call GET /marketing/emails/templates?locationId={id}. To update, use PUT /marketing/emails/templates/{id}. To delete, send DELETE /marketing/emails/templates/{id}.
Handle the Response
A successful POST returns a 200 status with the template object:
{
"template": {
"id": "tmpl-001",
"name": "Welcome Email",
"subject": "Welcome to {{company_name}}!",
"preheader": "We're glad you're here",
"createdAt": "2026-03-07T12:00:00Z",
"updatedAt": "2026-03-07T12:00:00Z"
}
}
Save the template.id for subsequent operations. The template is immediately available for use in campaigns and workflows after creation.
Common errors: 400 means a required field like name or body is missing. 401 means your token is invalid. 404 on update or delete means the template ID does not exist. 422 may occur if the HTML body contains unsupported elements or exceeds the size limit.
Test Your Setup
Run through this checklist to confirm everything works:
- Create a template with
POST /marketing/emails/templatesand save the returnedid - List templates with
GET /marketing/emails/templatesand verify your new template appears - Update the subject line with
PUT /marketing/emails/templates/{id} - Verify the template appears in Marketing > Emails > Templates in the GHL dashboard
- Delete the test template with
DELETE /marketing/emails/templates/{id}and confirm removal
If merge fields do not render in test sends, verify you are using the correct GHL merge field syntax with double curly braces and the exact field name from your contact properties.
Next Steps
Read the full Email Template CRUD Guide for advanced patterns including dynamic content blocks, conditional sections, and template versioning. From here, explore Email Campaigns for sending campaigns with templates and Media Library for managing email images and attachments.