Create an email

post

/api/REST/2.0/assets/email

Creates an email that matches the criteria specified by the request body for htmlContent with a type of RawHtmlContent. Creating emails with the type ResponsiveHtmlContent is not supported. If you use this endpoint with this email type, we cannot guarantee your email will be responsive.

Request

Supported Media Types
Body ()
The request body defines the details of the email to be created.
Root Schema : Email
Type: object
Title: Email
Show Source
Nested Schema : attachments
Type: array
A list of imported files.
Show Source
Nested Schema : contentSections
Type: array
A list of content sections contained within the email.
Show Source
Nested Schema : contentServiceInstances
Type: array
Show Source
Nested Schema : dynamicContents
Type: array
A list of dynamic contents contained within the email.
Show Source
Nested Schema : fieldMerges
Type: array
A list of associated Field Merges.
Show Source
Nested Schema : files
Type: array
A list of imported files.
Show Source
Nested Schema : forms
Type: array
A list of associated Form assets.
Show Source
Nested Schema : HtmlContent
Type: object
Title: HtmlContent
Show Source
Nested Schema : images
Type: array
A list of associated Image assets.
Show Source
Nested Schema : permissions
Type: array
The permissions for the email granted to your current instance. This is a read-only property.
Show Source
Nested Schema : ImportedFile
Type: object
Title: ImportedFile
Show Source
Nested Schema : permissions
Type: array
The permissions for the imported file granted to your current instance.
Show Source
Nested Schema : ContentSection
Type: object
Title: ContentSection
Show Source
Nested Schema : files
Type: array
A list of associated files.
Show Source
Nested Schema : forms
Type: array
A list of associated Form assets.
Show Source
Nested Schema : images
Type: array
A list of associated Image assets.
Show Source
Nested Schema : permissions
Type: array
The permissions for the content section granted to your current instance. This is a read-only property.
Show Source
Nested Schema : Size
Type: object
Title: Size
Show Source
Nested Schema : Form
Type: object
Title: Form
Show Source
Nested Schema : FormFieldUpdateMapping
Type: object
Title: FormFieldUpdateMapping
Show Source
Nested Schema : elements
Type: array
Array consisting of form elements.
Show Source
Nested Schema : permissions
Type: array
The permissions for the form granted to your current instance. This is a read-only property.
Show Source
Nested Schema : processingSteps
Type: array
A list of the form's processing steps. There is no limit to the number of processing steps that can be included. Possible values include: FormStepAddToCampaign, FormStepAddToContactList, FormStepAddToDataCanvas, FormStepAddToProgram, FormStepAssociateToCampaign, FormStepCancelRegistration, FormStepUpdateContactEmailAddress, FormStepCreateUpdateEventRegistration, FormStepCreateUpdate, FormStepCreateUpdateFromFormField, FormStepGlobalSubscribe, FormStepGlobalUnsubscribe, FormStepGroupSubscription, FormStepPostData, FormStepRedirectToWebPage, FormStepRemoveFromContactList, FormStepRunIntegrationRules, FormStepSendEmail, FormStepSendNotificationEmail, and FormStepWebTracking.
Show Source
Nested Schema : permissions
Type: array
The permissions for the form field update mapping granted to your current instance. This is a read-only property.
Show Source
Nested Schema : FormElement
Type: object
Title: FormElement
Show Source
Nested Schema : permissions
Type: array
The permissions for the form element granted to your current instance.
Show Source
Nested Schema : FormProcessingStep
Type: object
Title: FormProcessingStep
Show Source
Nested Schema : ProcessingStepCondition
Type: object
Title: ProcessingStepCondition
Show Source
Nested Schema : permissions
Type: array
The permissions for the form processing step granted to your current instance.
Show Source
Nested Schema : conditionalFieldCriteria
Type: array
The conditional field criteria for the form processing step condition.
Show Source
Nested Schema : FieldComparisonCriteria
Type: object
Title: FieldComparisonCriteria
Show Source
Nested Schema : Condition
Type: object
Title: Condition
Show Source
Nested Schema : permissions
Type: array
The permissions for the field comparison criteria granted to your current instance. This is a read-only property.
Show Source
Nested Schema : Hyperlink
Type: object
Title: Hyperlink
Show Source
Nested Schema : permissions
Type: array
The permissions for the hyperlink granted to your current instance.
Show Source
Nested Schema : ImageFile
Type: object
Title: ImageFile
Show Source
Nested Schema : permissions
Type: array
The permissions for the image granted to your current instance. This is a read-only property.
Show Source
Nested Schema : CloudComponentInstance
Type: object
Title: CloudComponentInstance
Show Source
Nested Schema : DynamicContent
Type: object
Title: DynamicContent
Show Source
Nested Schema : permissions
Type: array
The permissions for the dynamic content granted to your current instance. This is a read-only property.
Show Source
Nested Schema : rules
Type: array
The dynamic content's rules.
Show Source
Nested Schema : DynamicContentRule
Type: object
Title: DynamicContentRule
Show Source
Nested Schema : criteria
Type: array
The criteria of the dynamic content rule.
Show Source
Nested Schema : Criterion
Type: object
Title: Criterion
Show Source
Nested Schema : permissions
Type: array
The permissions for the criterion granted to your current instance.
Show Source
Nested Schema : FieldMerge
Type: object
Title: FieldMerge
Show Source
Nested Schema : fieldConditions
Type: array
Array of field condition fields.
Show Source
Nested Schema : permissions
Type: array
The permissions for the field merge granted to your current instance.
Show Source
Nested Schema : FieldCondition
Type: object
Title: FieldCondition
Show Source
Nested Schema : permissions
Type: array
Show Source
Back to Top

Response

Supported Media Types

201 Response

Success
Body ()
Root Schema : Email
Type: object
Title: Email
Show Source
Nested Schema : attachments
Type: array
A list of imported files.
Show Source
Nested Schema : contentSections
Type: array
A list of content sections contained within the email.
Show Source
Nested Schema : contentServiceInstances
Type: array
Show Source
Nested Schema : dynamicContents
Type: array
A list of dynamic contents contained within the email.
Show Source
Nested Schema : fieldMerges
Type: array
A list of associated Field Merges.
Show Source
Nested Schema : files
Type: array
A list of imported files.
Show Source
Nested Schema : forms
Type: array
A list of associated Form assets.
Show Source
Nested Schema : HtmlContent
Type: object
Title: HtmlContent
Show Source
Nested Schema : images
Type: array
A list of associated Image assets.
Show Source
Nested Schema : permissions
Type: array
The permissions for the email granted to your current instance. This is a read-only property.
Show Source
Nested Schema : ImportedFile
Type: object
Title: ImportedFile
Show Source
Nested Schema : permissions
Type: array
The permissions for the imported file granted to your current instance.
Show Source
Nested Schema : ContentSection
Type: object
Title: ContentSection
Show Source
Nested Schema : files
Type: array
A list of associated files.
Show Source
Nested Schema : forms
Type: array
A list of associated Form assets.
Show Source
Nested Schema : images
Type: array
A list of associated Image assets.
Show Source
Nested Schema : permissions
Type: array
The permissions for the content section granted to your current instance. This is a read-only property.
Show Source
Nested Schema : Size
Type: object
Title: Size
Show Source
Nested Schema : Form
Type: object
Title: Form
Show Source
Nested Schema : FormFieldUpdateMapping
Type: object
Title: FormFieldUpdateMapping
Show Source
Nested Schema : elements
Type: array
Array consisting of form elements.
Show Source
Nested Schema : permissions
Type: array
The permissions for the form granted to your current instance. This is a read-only property.
Show Source
Nested Schema : processingSteps
Type: array
A list of the form's processing steps. There is no limit to the number of processing steps that can be included. Possible values include: FormStepAddToCampaign, FormStepAddToContactList, FormStepAddToDataCanvas, FormStepAddToProgram, FormStepAssociateToCampaign, FormStepCancelRegistration, FormStepUpdateContactEmailAddress, FormStepCreateUpdateEventRegistration, FormStepCreateUpdate, FormStepCreateUpdateFromFormField, FormStepGlobalSubscribe, FormStepGlobalUnsubscribe, FormStepGroupSubscription, FormStepPostData, FormStepRedirectToWebPage, FormStepRemoveFromContactList, FormStepRunIntegrationRules, FormStepSendEmail, FormStepSendNotificationEmail, and FormStepWebTracking.
Show Source
Nested Schema : permissions
Type: array
The permissions for the form field update mapping granted to your current instance. This is a read-only property.
Show Source
Nested Schema : FormElement
Type: object
Title: FormElement
Show Source
Nested Schema : permissions
Type: array
The permissions for the form element granted to your current instance.
Show Source
Nested Schema : FormProcessingStep
Type: object
Title: FormProcessingStep
Show Source
Nested Schema : ProcessingStepCondition
Type: object
Title: ProcessingStepCondition
Show Source
Nested Schema : permissions
Type: array
The permissions for the form processing step granted to your current instance.
Show Source
Nested Schema : conditionalFieldCriteria
Type: array
The conditional field criteria for the form processing step condition.
Show Source
Nested Schema : FieldComparisonCriteria
Type: object
Title: FieldComparisonCriteria
Show Source
Nested Schema : Condition
Type: object
Title: Condition
Show Source
Nested Schema : permissions
Type: array
The permissions for the field comparison criteria granted to your current instance. This is a read-only property.
Show Source
Nested Schema : Hyperlink
Type: object
Title: Hyperlink
Show Source
Nested Schema : permissions
Type: array
The permissions for the hyperlink granted to your current instance.
Show Source
Nested Schema : ImageFile
Type: object
Title: ImageFile
Show Source
Nested Schema : permissions
Type: array
The permissions for the image granted to your current instance. This is a read-only property.
Show Source
Nested Schema : CloudComponentInstance
Type: object
Title: CloudComponentInstance
Show Source
Nested Schema : DynamicContent
Type: object
Title: DynamicContent
Show Source
Nested Schema : permissions
Type: array
The permissions for the dynamic content granted to your current instance. This is a read-only property.
Show Source
Nested Schema : rules
Type: array
The dynamic content's rules.
Show Source
Nested Schema : DynamicContentRule
Type: object
Title: DynamicContentRule
Show Source
Nested Schema : criteria
Type: array
The criteria of the dynamic content rule.
Show Source
Nested Schema : Criterion
Type: object
Title: Criterion
Show Source
Nested Schema : permissions
Type: array
The permissions for the criterion granted to your current instance.
Show Source
Nested Schema : FieldMerge
Type: object
Title: FieldMerge
Show Source
Nested Schema : fieldConditions
Type: array
Array of field condition fields.
Show Source
Nested Schema : permissions
Type: array
The permissions for the field merge granted to your current instance.
Show Source
Nested Schema : FieldCondition
Type: object
Title: FieldCondition
Show Source
Nested Schema : permissions
Type: array
Show Source

400 Response

Bad request. See Status Codes for information about other possible HTTP status codes.

401 Response

Unauthorized. See Status Codes for information about other possible HTTP status codes.

403 Response

Forbidden. See Status Codes for information about other possible HTTP status codes.

404 Response

The requested resource was not found. See Status Codes for information about other possible HTTP status codes.

500 Response

The service has encountered an error. See Status Codes for information about other possible HTTP status codes.
Back to Top

Examples

Create a new email:


POST /api/REST/2.0/assets/email
Content-Type: application/json 
			

Request body:


{
    "name": "My Test Email",
    "emailFooterId": 1,
    "emailHeaderId": 1,
    "encodingId": 1,
    "emailGroupId": 1,
    "subject": "Test subject line",
    "htmlContent": {
        "type": "RawHtmlContent",
        "html": "<html><head></head><body>This is the email.</body></html>"
    }
}
			

Response:


{
    "type": "Email",
    "x_e10_previewUrl": "https:\/\/((yourpod)).eloquapreview.com\/Preview.aspx?siteId=2097339171&userGuid=eb14c8ca-d741-42b2-a291-35dddbe33795",
    "x_e10_previewExpiryDate": "1564065731",
    "currentStatus": "Draft",
    "id": "243",
    "createdAt": "1564065432",
    "createdBy": "9",
    "depth": "complete",
    "folderId": "42",
    "name": "My Test Email",
    "permissions": [
        "Retrieve",
        "SetSecurity",
        "Delete",
        "Update"
    ],
    "updatedAt": "1564065432",
    "updatedBy": "9",
    "archive": "false",
    "bounceBackEmail": "newclient@qa01en25.com",
    "contentSections": [],
    "dynamicContents": [],
    "emailFooterId": "1",
    "emailGroupId": "1",
    "emailHeaderId": "1",
    "encodingId": "1",
    "fieldMerges": [],
    "forms": [],
    "htmlContent": {
        "type": "RawHtmlContent",
        "contentSource": "upload",
        "html": "<html><head><\/head><body>This is the email.<\/body><\/html>"
    },
    "hyperlinks": [],
    "images": [],
    "isContentProtected": "false",
    "isPlainTextEditable": "false",
    "isPrivate": "False",
    "isTracked": "false",
    "layout": "",
    "plainText": "This is the email.",
    "renderMode": "Fixed",
    "replyToEmail": "newclient@qa01en25.com",
    "replyToName": "New Client",
    "sendPlainTextOnly": "false",
    "senderEmail": "newclient@qa01en25.com",
    "senderName": "New Client",
    "style": "",
    "subject": "Test subject line",
    "virtualMTAId": "1"
}
			
Back to Top