Skip to content

Create New Email

POST /api.php

This endpoint is used to create a new email record associated with the user's account.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.CreateYes
RelUserIDThe ID of the user related to the emailYes
bash
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "Command": "Email.Create",
    "RelUserID": "12345"
}'
json
{
    "Success": true,
    "ErrorCode": 0,
    "EmailID": "new-email-id"
}
txt
No error code is returned for this API end-point
txt
No error code is returned for this API end-point

Delete Email

POST /api.php

This endpoint allows for the deletion of an email associated with a user's account. The user must provide the unique identifier of the email they wish to delete.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandThe API command parameter, in this case, Email.DeleteYes
EmailIDThe unique identifier of the email to be deletedYes
bash
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{"SessionID": "your-session-id", "APIKey": "your-api-key", "Command": "Email.Delete", "EmailID": "123"}'
json
{
  "Success": true,
  "ErrorCode": 0,
  "ErrorText": ""
}
json
{
  "Success": false,
  "ErrorCode": 1,
  "ErrorText": "Required field missing: EmailID"
}
txt
1: Required field missing: EmailID

Duplicate an Email

POST /api.php

This endpoint duplicates an existing email by its unique identifier and associates the duplicate with the current user's account.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.DuplicateYes
EmailIDThe unique identifier of the email to duplicateYes
bash
curl -X POST https://yourdomain.com/api.php \
-H "Content-Type: application/json" \
-d '{"SessionID": "your-session-id", "APIKey": "your-api-key", "Command": "Email.Duplicate", "EmailID": "123"}'
json
{
  "Success": true,
  "ErrorCode": 0,
  "EmailID": "124",
  "EmailName": "Copy of Original Email Name"
}
json
{
  "Success": false,
  "ErrorCode": [1]
}
txt
1: The 'EmailID' parameter is missing or invalid.
2: The specified email does not exist or you do not have permission to access it.

Preview an Email

POST /api.php

This endpoint allows you to preview an email by sending it to a specified email address. It is useful for testing the appearance and content of an email before sending it out to the actual recipients.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.EmailPreviewYes
EmailIDThe unique identifier for the email to be previewedYes
EmailAddressThe email address where the preview will be sentYes
CampaignIDThe ID of the campaign associated with the email (optional)No
ListIDThe ID of the list associated with the email (optional)No
AddUserGroupHeaderFooterBoolean to decide if user group header and footer should be added (optional)No
EmailTypeType of the email, e.g., 'optinconfirmation' (optional)No
bash
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "Command": "Email.EmailPreview",
    "EmailID": "123",
    "EmailAddress": "test@example.com",
    "CampaignID": "456",
    "ListID": "789",
    "AddUserGroupHeaderFooter": true,
    "EmailType": "optinconfirmation"
}'
json
{
  "Success": true,
  "ErrorCode": 0
}
json
{
  "Success": false,
  "ErrorCode": 1
}
txt
1: Email ID is required.
2: Email address is required.
3: Email not found.
4: Invalid email address format.
6: List not found.
7: Campaign not found.
8: Sender domain not found or not associated with the user.

Retrieve Email Information

POST /api.php

This endpoint retrieves detailed information about a specific email by its unique identifier.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.GetYes
EmailIDThe unique identifier of the email to retrieveYes
bash
curl -X POST https://yourdomain.com/api.php \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "Command": "Email.Get",
    "EmailID": "12345"
}'
json
{
    "Success": true,
    "ErrorCode": 0,
    "EmailInformation": {
        "EmailID": "12345",
        "Subject": "Your Email Subject",
        "Body": "The content of the email...",
        // ... other email details
    }
}
json
{
    "Success": false,
    "ErrorCode": [1]
}
txt
1: The required parameter 'EmailID' is missing.
2: Email not found or you do not have permission to view it.

Retrieve Personalization Tags

POST /api.php

This endpoint allows the retrieval of various personalization tags based on the specified scope. Personalization tags can include subscriber information, campaign links, opt-in links, list links, and user information.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.PersonalizationTagsYes
ScopeA list of scopes to retrieve personalization tags for. Possible values are 'Subscriber', 'CampaignLinks', 'OptLinks', 'ListLinks', 'AllLinks', 'User'.Yes
ListIDThe ID of the list to retrieve subscriber tags for. Required if 'Subscriber' is included in the scope.Conditional
bash
curl -X POST https://example.com/api.php \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "Command": "Email.PersonalizationTags",
    "Scope": ["Subscriber", "User"],
    "ListID": "123"
}'
json
{
  "Success": true,
  "ErrorCode": 0,
  "PersonalizationTags": [
    // ... list of personalization tags ...
  ]
}
json
{
  "Success": false,
  "ErrorCode": {
    "scope": 1,
    "listid": 2
  }
}
txt
1: Scope parameter is missing or invalid.
2: ListID is required when 'Subscriber' is included in the scope.

Email Spam Test

POST /api.php

This endpoint performs a spam test on an email by passing its content through a spam filter and returning the results.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.SpamTestYes
EmailIDThe unique identifier of the email to be testedYes
bash
curl -X POST https://yourdomain.com/api.php \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "Command": "Email.SpamTest",
    "EmailID": "12345"
}'
json
{
    "Success": true,
    "ErrorCode": 0,
    "TestResults": {
        "SpamStatus": "No",
        "Score": 1.5,
        "Details": "Details of the spam test results..."
    }
}
json
{
    "Success": false,
    "ErrorCode": 1,
    "ErrorMessage": "Email ID is required."
}
txt
1: Email ID is required.
2: Email not found.
3: Error processing spam test.

Update Email Content

POST /api.php

This endpoint allows updating the content and settings of an existing email by providing the necessary parameters.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmail.UpdateYes
EmailIDUnique identifier for the email to be updatedYes
ValidateScopeScope of validation for the email content (OptIn, Campaign, AutoResponder)Yes
ModeThe mode of the email content (Editor, Stripo, Unlayer, etc.)No
RelTemplateIDThe ID of the related template, if applicableNo
SenderDomainThe sender's domain to be used for the emailNo
FromEmailThe email address that appears in the "from" fieldNo
FromNameThe name that appears in the "from" fieldNo
ReplyToEmailThe email address that appears in the "reply-to" fieldNo
ReplyToNameThe name that appears in the "reply-to" fieldNo
SubjectThe subject line of the emailNo
HTMLContentThe HTML content of the emailNo
PlainContentThe plain text content of the emailNo
FetchURLURL to fetch HTML content from, if mode is 'Import'No
FetchPlainURLURL to fetch plain text content from, if mode is 'Import'No
ImageEmbeddingIndicates if images should be embedded in the email contentNo
PreHeaderTextPre-header text to be included in the emailNo
ExtraContent1Additional content field 1No
ExtraContent2Additional content field 2No
PlainContentAutoConvertIndicates if plain content should be auto-converted from HTML contentNo
SubjectSetToTitleElementIndicates if the subject should be set to the title element of HTML contentNo
bash
curl -X POST https://example.com/api.php \
  -d 'SessionID=example-session-id' \
  -d 'APIKey=example-api-key' \
  -d 'Command=Email.Update' \
  -d 'EmailID=123' \
  -d 'ValidateScope=OptIn' \
  -d 'Mode=Editor' \
  -d 'HTMLContent=<p>Your updated email content here</p>' \
  -d 'Subject=Updated Subject Line'
json
{
  "Success": true,
  "ErrorCode": 0
}
json
{
  "Success": false,
  "ErrorCode": [1]
}
txt
1: Email ID is required
3: Email does not exist
4: Invalid mode specified
5: Template ID is required when mode is 'Template'
6: Invalid FromEmail format
7: Invalid ReplyToEmail format
8: Content type cannot be empty
9: ValidateScope is required
10: Invalid ValidateScope value
11: Unsubscribe link is required in HTML content
12: Unsubscribe link is required in Plain content
13: Confirm link is required in HTML content
14: Confirm link is required in Plain content
15: Reject link is required in HTML content
16: Reject link is required in Plain content
17: Sender domain does not exist

Retrieve List of Emails

POST /api.php

This API call returns the list of email contents associated with the user's account.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current sessionYes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandEmails.GetYes
bash
curl -X POST https://yourdomain.com/api.php \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "Command": "Emails.Get"
}'
json
{
    "Success": true,
    "ErrorCode": 0,
    "ErrorText": "",
    "TotalEmailCount": 5,
    "Emails": [
        // ...
        // Email records
        // ...
    ]
}
txt
No error code is returned for this API end-point
txt
No error code is returned for this API end-point

Any questions? Contact us.