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.

Render an Email

GET /api/v1/email.render

This API endpoint renders an email and returns the HTML content of the email.

Request Body Parameters:

ParameterDescriptionRequired?
SessionIDThe ID of the user's current session.Yes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
UserIDThe ID of the user associated with the email.Yes
ListIDThe ID of the list associated with the email.Yes
SubscriberIDThe ID of the subscriber associated with the email.Yes
CampaignIDThe ID of the campaign associated with the email.No
AutoResponderIDThe ID of the autoresponder associated with the email.No
EmailIDThe ID of the email to render.Yes
QueueRowIDThe ID of the email gateway queue row associated with the email.No
IsPreviewIndicates if the email is a preview. 1 or 0Yes
DisablePersonalizationIndicates if personalization should be disabled. 1 or 0No
bash
curl -X POST https://example.com/api/v1/email.render \
-H "Content-Type: application/json" \
-d '{
    "SessionID": "your-session-id",
    "APIKey": "your-api-key",
    "UserID": "123",
    "ListID": "456",
    "SubscriberID": "789",
    "CampaignID": "1011",
    "AutoResponderID": "1213",
    "EmailID": "1415",
    "QueueRowID": "1617",
    "IsPreview": 1,
    "DisablePersonalization": 0
}'
json
{
    "Subject": "Test AR For cem.hurturk+70@gmail.com",
    "EmailContent": "<html>...</html>"
}
json
{
  "Success": false,
  "ErrorCode": 1
}
txt
1: Missing UserID parameter
2: Missing ListID parameter
3: Missing SubscriberID parameter
4: Missing CampaignID parameter
5: Missing AutoResponderID parameter
6: Missing EmailID parameter
7: Missing QueueRowID parameter
8: Missing IsPreview parameter
9: Missing DisablePersonalization parameter
10: Invalid UserID parameter
11: Invalid ListID parameter
12: Invalid SubscriberID parameter
13: Invalid CampaignID parameter
14: Invalid AutoResponderID parameter
15: Invalid EmailID parameter
16: Invalid QueueRowID parameter

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 session.Yes
APIKeyThe user's API key. Either SessionID or APIKey must be provided.Yes
CommandThe command for email preview, set as Email.EmailPreview.Yes
EmailIDThe unique identifier of the email to be previewed.Yes
EmailAddressThe email address where the preview will be sent.Yes
CampaignIDThe ID of the campaign associated with the email (optional).No
ListIDThe ID of the list associated with the email (optional).No
SubscriberIDThe ID of the target subscriber to preview the email with (optional).No
AddUserGroupHeaderFooterIndicates if the user group header and footer should be added (optional).No
EmailTypeThe type of the email, e.g., 'optinconfirmation' (optional).No
HTMLContentThe HTML content of the preview email (if EmailID is not provided).No
PlainTextContentThe plain text content of the preview email (if EmailID is not provided).No
FromNameThe "from name" email header of the preview email (if EmailID is not provided). If not provided, Preview Email will be set.No
FromEmailAddressThe "from email address" header of the preview email (if EmailID is not provided). If not provided, preview@preview.com will be set.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..."
  }
}
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": [
  ]
}
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 email. This is a required parameter if "Sender Domain Management" feature is enabled in user group settings. This parameter accepts the domain name, such as "mysenderdomain.com".No
EmailNameThe name of 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
OpenTrackingIndicates if open tracking should be enabled for the email. true or falseNo
LinkTrackingIndicates if click tracking should be enabled for the email. true or falseNo
UTMTrackingIndicates if UTM tracking should be enabled for the email. true or falseNo
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": [
  ]
}
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.