User Email Template API Documentation
User email template management endpoints for creating, listing, retrieving, updating, deleting, and copying user-owned email templates. These endpoints operate on IsEmailTemplate=1 records in the emails table, which are distinct from the legacy gallery templates managed via email.template.* endpoints.
Create a User Email Template
POST/api/v1/useremailtemplateAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.create |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| EmailName | String | Yes | Template name |
| Subject | String | Yes | Email subject line |
| PreHeaderText | String | No | Pre-header text displayed in email clients |
| ContentType | String | No | Email content type. Possible values: HTML, Plain, Both. Default: HTML |
| HTMLContent | String | No | HTML email content |
| PlainContent | String | No | Plain text email content |
| ExtraContent1 | String | No | Stripo HTML template data |
| ExtraContent2 | String | No | Stripo CSS template data |
| Mode | String | No | Email editor mode. Possible values: Stripo, Editor. Default: Editor |
| ImageEmbedding | String | No | Image embedding setting. Possible values: Enabled, Disabled. Default: Disabled |
curl -X POST https://example.com/api/v1/useremailtemplate \
-H "Content-Type: application/json" \
-d '{
"Command": "useremailtemplate.create",
"SessionID": "your-session-id",
"EmailName": "Welcome Email Template",
"Subject": "Welcome to our newsletter!",
"PreHeaderText": "Thanks for subscribing",
"ContentType": "HTML",
"HTMLContent": "<html><body><h1>Welcome!</h1></body></html>",
"Mode": "Editor",
"ImageEmbedding": "Disabled"
}'{
"Success": true,
"ErrorCode": 0,
"EmailID": 42
}{
"Errors": [
{
"Code": 1,
"Message": "Missing EmailName parameter"
},
{
"Code": 2,
"Message": "Missing Subject parameter"
}
]
}1: Missing EmailName parameter
2: Missing Subject parameter
3: Invalid ContentType. Must be one of: HTML, Plain, Both
4: Invalid Mode. Must be one of: Stripo, Editor
5: Invalid ImageEmbedding. Must be one of: Enabled, DisabledList User Email Templates
GET/api/v1/useremailtemplatesAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplates.get |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| OrderField | String | No | Field to sort results by. Possible values: CreatedAt, EmailName. Default: CreatedAt |
| OrderType | String | No | Sort direction. Possible values: ASC, DESC. Default: DESC |
| Limit | Integer | No | Number of records to return (1-100). Default: 25 |
| Offset | Integer | No | Number of records to skip. Default: 0 |
curl -X GET "https://example.com/api/v1/useremailtemplates?SessionID=your-session-id&OrderField=CreatedAt&OrderType=DESC&Limit=10&Offset=0"{
"Success": true,
"ErrorCode": 0,
"TotalEmailTemplateCount": 25,
"EmailTemplates": [
{
"EmailID": "42",
"RelUserID": "1",
"EmailName": "Welcome Email Template",
"Subject": "Welcome to our newsletter!",
"ContentType": "HTML",
"Mode": "Editor",
"IsEmailTemplate": "1",
"CreatedAt": "2025-03-14 10:00:00",
"UpdatedAt": "2025-03-14 10:00:00",
"DeletedAt": null
}
]
}{
"Success": true,
"ErrorCode": 0,
"TotalEmailTemplateCount": 0,
"EmailTemplates": []
}No specific error codes. Returns empty array when no templates found.Get a User Email Template
GET/api/v1/useremailtemplateAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.get |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| EmailID | Integer | Yes | ID of the email template to retrieve |
curl -X GET "https://example.com/api/v1/useremailtemplate?SessionID=your-session-id&EmailID=42"{
"Success": true,
"ErrorCode": 0,
"EmailTemplate": {
"EmailID": "42",
"RelUserID": "1",
"EmailName": "Welcome Email Template",
"Subject": "Welcome to our newsletter!",
"PreHeaderText": "Thanks for subscribing",
"ContentType": "HTML",
"HTMLContent": "<html><body><h1>Welcome!</h1></body></html>",
"PlainContent": "",
"ExtraContent1": "",
"ExtraContent2": "",
"Mode": "Editor",
"ImageEmbedding": "Disabled",
"IsEmailTemplate": "1",
"CreatedAt": "2025-03-14 10:00:00",
"UpdatedAt": "2025-03-14 10:00:00",
"DeletedAt": null,
"Attachments": []
}
}{
"Success": false,
"Errors": [
{
"Code": 3,
"Message": "Email template not found"
}
]
}1: Missing EmailID parameter
2: Invalid EmailID. Must be a numeric value.
3: Email template not foundUpdate a User Email Template
PATCH/api/v1/useremailtemplateAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.update |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| EmailID | Integer | Yes | ID of the email template to update |
| EmailName | String | No | Updated template name |
| Subject | String | No | Updated email subject line |
| PreHeaderText | String | No | Updated pre-header text |
| ContentType | String | No | Updated content type. Possible values: HTML, Plain, Both |
| HTMLContent | String | No | Updated HTML email content |
| PlainContent | String | No | Updated plain text content |
| ExtraContent1 | String | No | Updated Stripo HTML template data |
| ExtraContent2 | String | No | Updated Stripo CSS template data |
| Mode | String | No | Updated editor mode. Possible values: Stripo, Editor |
| ImageEmbedding | String | No | Updated image embedding. Possible values: Enabled, Disabled |
curl -X PATCH https://example.com/api/v1/useremailtemplate \
-H "Content-Type: application/json" \
-d '{
"Command": "useremailtemplate.update",
"SessionID": "your-session-id",
"EmailID": 42,
"EmailName": "Updated Welcome Template",
"Subject": "Welcome aboard!"
}'{
"Success": true,
"ErrorCode": 0
}{
"Success": false,
"Errors": [
{
"Code": 6,
"Message": "Email template not found"
}
]
}1: Missing EmailID parameter
2: Invalid EmailID. Must be a numeric value.
3: Invalid ContentType. Must be one of: HTML, Plain, Both
4: Invalid Mode. Must be one of: Stripo, Editor
5: Invalid ImageEmbedding. Must be one of: Enabled, Disabled
6: Email template not foundDelete User Email Templates
DELETE/api/v1/useremailtemplateAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.delete |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| EmailID | String | Yes | ID(s) of the email template(s) to delete. Supports comma-separated values for batch deletion (e.g., 42,43,44) |
curl -X DELETE https://example.com/api/v1/useremailtemplate \
-H "Content-Type: application/json" \
-d '{
"Command": "useremailtemplate.delete",
"SessionID": "your-session-id",
"EmailID": "42,43,44"
}'{
"Success": true,
"ErrorCode": 0,
"DeletedCount": 3
}{
"Errors": [
{
"Code": 1,
"Message": "Missing EmailID parameter"
}
]
}1: Missing EmailID parameterCopy a User Email Template
POST/api/v1/useremailtemplate.copyAPI Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.copy |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| EmailID | Integer | Yes | ID of the email template to copy |
curl -X POST https://example.com/api/v1/useremailtemplate.copy \
-H "Content-Type: application/json" \
-d '{
"Command": "useremailtemplate.copy",
"SessionID": "your-session-id",
"EmailID": 42
}'{
"Success": true,
"ErrorCode": 0,
"EmailID": 45,
"EmailName": "Copy of Welcome Email Template"
}{
"Success": false,
"Errors": [
{
"Code": 3,
"Message": "Email template not found"
}
]
}1: Missing EmailID parameter
2: Invalid EmailID. Must be a numeric value.
3: Email template not foundCopy a User Email Template to Another User
POST/api/v1/useremailtemplate.copytouserAPI Usage Notes
- Authentication required: Admin API Key
- Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.copytouser |
| SessionID | String | No | Session ID obtained from admin login |
| AdminAPIKey | String | No | Admin API key for authentication |
| EmailID | Integer | Yes | ID of the email template to copy |
| SourceUserID | Integer | Yes | ID of the user who owns the source template |
| TargetUserID | Integer | Yes | ID of the user to receive the copied template |
curl -X POST https://example.com/api/v1/useremailtemplate.copytouser \
-H "Content-Type: application/json" \
-d '{
"Command": "useremailtemplate.copytouser",
"AdminAPIKey": "your-admin-api-key",
"EmailID": 42,
"SourceUserID": 1,
"TargetUserID": 5
}'{
"Success": true,
"ErrorCode": 0,
"EmailID": 46
}{
"Success": false,
"Errors": [
{
"Code": 9,
"Message": "Email template not found for source user"
}
]
}1: Missing EmailID parameter
2: Missing SourceUserID parameter
3: Missing TargetUserID parameter
4: Invalid EmailID. Must be a numeric value.
5: Invalid SourceUserID. Must be a numeric value.
6: Invalid TargetUserID. Must be a numeric value.
7: Source user not found
8: Target user not found
9: Email template not found for source userPreview a User Email Template
POST/api/v1/useremailtemplate.previewRenders a user email template the way a subscriber would actually receive it: branding header/footer applied, merge tags resolved. Composes the existing personalization primitives behind a preview-safe entry point — no Campaign / Subscriber / EmailQueue context is required, so this is suitable for headless frontends and external preview UIs.
API Usage Notes
- Authentication required: User API Key
- Required permissions:
EmailTemplates.Manage - Rate limit: 100 requests per 60 seconds
- Legacy endpoint access via
/api.phpis also supported
Request Body Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| Command | String | Yes | API command: useremailtemplate.preview |
| SessionID | String | No | Session ID obtained from login |
| APIKey | String | No | API key for authentication |
| EmailTemplateID | Integer | Yes | ID of the user-owned email template to preview. Must belong to the authenticated user. |
| SampleData | Object | No | Map of merge-tag values to use during personalization (e.g. {"FirstName": "Jane", "Email": "jane@example.com"}). When omitted, sensible defaults are used so unfilled tags don't render as raw %Subscriber:Foo% strings. Caller-supplied values override the defaults. |
| IncludeBranding | Boolean | No | When true (default), wraps the template via the user's configured email header/footer (set via useremail.header.set / useremail.footer.set and the user-group's branding). When false, returns the personalized body only. |
curl -X POST https://example.com/api/v1/useremailtemplate.preview \
-H "Content-Type: application/json" \
-d '{
"Command": "useremailtemplate.preview",
"APIKey": "your-api-key",
"EmailTemplateID": 42,
"SampleData": {
"FirstName": "Jane",
"Email": "jane@example.com"
},
"IncludeBranding": true
}'{
"Success": true,
"ErrorCode": 0,
"HTMLContent": "<html><body>...header...<p>Hello Jane, welcome.</p>...footer...</body></html>",
"PlainContent": "...header...\nHello Jane, welcome.\n...footer..."
}{
"Success": false,
"Errors": [
{
"Code": 3,
"Message": "Email template not found"
}
]
}1: Missing EmailTemplateID parameter
2: Invalid EmailTemplateID. Must be a numeric value.
3: Email template not found
4: Invalid SampleData. Must be an object.
5: Invalid SampleData values. All values must be scalar (string, number, boolean) or null.
6: Invalid IncludeBranding. Must be a boolean value.
Help Portal