Email - Manage Send Definitions (REST API)

POST Create a send definition

POST /sobjects/ListEmail

Operation ID: createSendDefinition. Tags: Send Definitions.

Creates a ListEmail record that contains a send definition. Use the resulting send definition ID in requests to Direct Email Send API.

Request body (required)

Media type: application/json. Schema: SendDefinitionCreate.

Example

{
  "Name": "welcome-email@1.0.0",
  "FromName": "Northern Trail Outfitters",
  "FromAddress": "noreply@example.com",
  "ReplyToAddress": "support@example.com",
  "ManagedContentId": "20YSB000004Fzs52AC",
  "MessagePurpose": "Transactional",
  "IsOpenTrackingEnabled": true,
  "IsClickTrackingEnabled": true,
  "Status": "Draft"
}

Responses

  • 201 Send definition created successfully.

    Media type: application/json. Schema: object.

    • id (string) The new send definition ID.
    • success (boolean) Indicates whether the operation succeeded.
    • errors (array of object) Array of errors if the operation failed.

    Example

    {
      "id": "0XBSG000000NY5p4AG",
      "success": true,
      "errors": []
    }
  • 400 Bad Request - Invalid field values or missing required fields

    Media type: application/json. Schema: SalesforceError.

    Example: duplicateValue Duplicate Name

    [
      {
        "message": "duplicate value found: Name duplicates value on record",
        "errorCode": "DUPLICATE_VALUE",
        "fields": [
          "Name"
        ]
      }
    ]

    Example: fieldIntegrity Unverified From Address

    [
      {
        "message": "The FromAddress is not verified",
        "errorCode": "FIELD_INTEGRITY_EXCEPTION",
        "fields": [
          "FromAddress"
        ]
      }
    ]
  • 401 Unauthorized - Invalid or expired token

    Media type: application/json. Schema: SalesforceError.

  • 403 Forbidden - Insufficient permissions or feature not enabled

    Media type: application/json. Schema: SalesforceError.

    Example: insufficientAccess Insufficient Access

    [
      {
        "message": "insufficient access rights on object id",
        "errorCode": "INSUFFICIENT_ACCESS"
      }
    ]

    Example: featureNotEnabled Feature Not Enabled

    [
      {
        "message": "Access denied: feature not enabled for tenant",
        "errorCode": "FEATURE_NOT_ENABLED"
      }
    ]