Interface EmailCampaigns

All Known Implementing Classes:
EmailCampaignsImpl

public interface EmailCampaigns
Email Campaigns API. Manage email marketing campaigns and retrieve their performance statistics.

These endpoints are token-scoped: the account is resolved from the API token, so the path takes no account id.

  • Method Details

    • getEmailCampaigns

      List the account's email campaigns, newest first.
      Parameters:
      filter - filtering and pagination parameters; null for the first page with API defaults
      Returns:
      a page of campaigns and the pagination metadata
    • createEmailCampaign

      EmailCampaignResponse createEmailCampaign(CreateEmailCampaign request)
      Create a new email campaign in the draft state.
      Parameters:
      request - the campaign attributes (name, domainId, fromLocalPart and a template subject are required)
      Returns:
      the created email campaign
    • getEmailCampaign

      EmailCampaignResponse getEmailCampaign(long emailCampaignId)
      Get a single email campaign by ID.
      Parameters:
      emailCampaignId - unique email campaign ID
      Returns:
      the email campaign
    • updateEmailCampaign

      EmailCampaignResponse updateEmailCampaign(long emailCampaignId, UpdateEmailCampaign request)
      Update an existing draft email campaign. Only the provided attributes are changed.
      Parameters:
      emailCampaignId - unique email campaign ID
      request - the attributes to update
      Returns:
      the updated email campaign
    • deleteEmailCampaign

      void deleteEmailCampaign(long emailCampaignId)
      Delete an email campaign. Only a campaign in the draft state can be deleted.
      Parameters:
      emailCampaignId - unique email campaign ID
    • startEmailCampaign

      EmailCampaignResponse startEmailCampaign(long emailCampaignId)
      Start sending a draft campaign immediately.
      Parameters:
      emailCampaignId - unique email campaign ID
      Returns:
      the started email campaign
    • scheduleEmailCampaign

      EmailCampaignResponse scheduleEmailCampaign(long emailCampaignId, ScheduleEmailCampaignRequest request)
      Schedule a draft campaign to start sending at a future time. The scheduled time is reported back in currentStateMetadata.scheduledAt.
      Parameters:
      emailCampaignId - unique email campaign ID
      request - when to start sending the campaign
      Returns:
      the scheduled email campaign
    • cancelEmailCampaign

      EmailCampaignResponse cancelEmailCampaign(long emailCampaignId)
      Cancel a scheduled campaign, returning it to the draft state.
      Parameters:
      emailCampaignId - unique email campaign ID
      Returns:
      the cancelled email campaign
    • terminateEmailCampaign

      EmailCampaignResponse terminateEmailCampaign(long emailCampaignId)
      Terminate a campaign that is currently sending (started, queued or paused), aborting the in-flight send.
      Parameters:
      emailCampaignId - unique email campaign ID
      Returns:
      the terminated email campaign
    • resetEmailCampaign

      EmailCampaignResponse resetEmailCampaign(long emailCampaignId)
      Reset a scheduled campaign back to the draft state.
      Parameters:
      emailCampaignId - unique email campaign ID
      Returns:
      the reset email campaign
    • getEmailCampaignStats

      EmailCampaignStatsResponse getEmailCampaignStats(long emailCampaignId, EmailCampaignStatsFilter filter)
      Get aggregated performance statistics for an email campaign. If the campaign has never been started, all counts and rates are returned as 0.
      Parameters:
      emailCampaignId - unique email campaign ID
      filter - aggregation window; null for the whole period since the campaign was last started
      Returns:
      aggregated campaign statistics