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 |
bash
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"
}'json
{
"Success": true,
"ErrorCode": 0,
"EmailID": 42
}json
{
"Errors": [
{
"Code": 1,
"Message": "Missing EmailName parameter"
},
{
"Code": 2,
"Message": "Missing Subject parameter"
}
]
}txt
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 |
bash
curl -X GET "https://example.com/api/v1/useremailtemplates?SessionID=your-session-id&OrderField=CreatedAt&OrderType=DESC&Limit=10&Offset=0"json
{
"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
}
]
}json
{
"Success": true,
"ErrorCode": 0,
"TotalEmailTemplateCount": 0,
"EmailTemplates": []
}txt
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 |
bash
curl -X GET "https://example.com/api/v1/useremailtemplate?SessionID=your-session-id&EmailID=42"json
{
"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": []
}
}json
{
"Success": false,
"Errors": [
{
"Code": 3,
"Message": "Email template not found"
}
]
}txt
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 |
bash
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!"
}'json
{
"Success": true,
"ErrorCode": 0
}json
{
"Success": false,
"Errors": [
{
"Code": 6,
"Message": "Email template not found"
}
]
}txt
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) |
bash
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"
}'json
{
"Success": true,
"ErrorCode": 0,
"DeletedCount": 3
}json
{
"Errors": [
{
"Code": 1,
"Message": "Missing EmailID parameter"
}
]
}txt
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 |
bash
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
}'json
{
"Success": true,
"ErrorCode": 0,
"EmailID": 45,
"EmailName": "Copy of Welcome Email Template"
}json
{
"Success": false,
"Errors": [
{
"Code": 3,
"Message": "Email template not found"
}
]
}txt
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 |
bash
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
}'json
{
"Success": true,
"ErrorCode": 0,
"EmailID": 46
}json
{
"Success": false,
"Errors": [
{
"Code": 9,
"Message": "Email template not found for source user"
}
]
}txt
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 user
Help Portal