Skip to content

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/useremailtemplate

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: EmailTemplates.Manage
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplate.create
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
EmailNameStringYesTemplate name
SubjectStringYesEmail subject line
PreHeaderTextStringNoPre-header text displayed in email clients
ContentTypeStringNoEmail content type. Possible values: HTML, Plain, Both. Default: HTML
HTMLContentStringNoHTML email content
PlainContentStringNoPlain text email content
ExtraContent1StringNoStripo HTML template data
ExtraContent2StringNoStripo CSS template data
ModeStringNoEmail editor mode. Possible values: Stripo, Editor. Default: Editor
ImageEmbeddingStringNoImage 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, Disabled

List User Email Templates

GET /api/v1/useremailtemplates

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: EmailTemplates.Manage
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplates.get
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
OrderFieldStringNoField to sort results by. Possible values: CreatedAt, EmailName. Default: CreatedAt
OrderTypeStringNoSort direction. Possible values: ASC, DESC. Default: DESC
LimitIntegerNoNumber of records to return (1-100). Default: 25
OffsetIntegerNoNumber 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/useremailtemplate

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: EmailTemplates.Manage
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplate.get
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
EmailIDIntegerYesID 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 found

Update a User Email Template

PATCH /api/v1/useremailtemplate

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: EmailTemplates.Manage
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplate.update
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
EmailIDIntegerYesID of the email template to update
EmailNameStringNoUpdated template name
SubjectStringNoUpdated email subject line
PreHeaderTextStringNoUpdated pre-header text
ContentTypeStringNoUpdated content type. Possible values: HTML, Plain, Both
HTMLContentStringNoUpdated HTML email content
PlainContentStringNoUpdated plain text content
ExtraContent1StringNoUpdated Stripo HTML template data
ExtraContent2StringNoUpdated Stripo CSS template data
ModeStringNoUpdated editor mode. Possible values: Stripo, Editor
ImageEmbeddingStringNoUpdated 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 found

Delete User Email Templates

DELETE /api/v1/useremailtemplate

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: EmailTemplates.Manage
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplate.delete
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
EmailIDStringYesID(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 parameter

Copy a User Email Template

POST /api/v1/useremailtemplate.copy

API Usage Notes

  • Authentication required: User API Key
  • Required permissions: EmailTemplates.Manage
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplate.copy
SessionIDStringNoSession ID obtained from login
APIKeyStringNoAPI key for authentication
EmailIDIntegerYesID 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 found

Copy a User Email Template to Another User

POST /api/v1/useremailtemplate.copytouser

API Usage Notes

  • Authentication required: Admin API Key
  • Rate limit: 100 requests per 60 seconds
  • Legacy endpoint access via /api.php is also supported

Request Body Parameters:

ParameterTypeRequiredDescription
CommandStringYesAPI command: useremailtemplate.copytouser
SessionIDStringNoSession ID obtained from admin login
AdminAPIKeyStringNoAdmin API key for authentication
EmailIDIntegerYesID of the email template to copy
SourceUserIDIntegerYesID of the user who owns the source template
TargetUserIDIntegerYesID 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

Any questions? Contact us.