Create Campaign

Create a new email campaign in your Lumail account

MethodPOST
/api/v1/campaigns

https://lumail.io/api/v1/campaigns

Create a new email campaign in your organization. The campaign is created with a DRAFT status and can be edited before scheduling or sending.

Response

  • Success (200 OK) - Returns the created campaign object.
  • Error (400 Bad Request) - Validation error or no email sender configured.
  • Error (401 Unauthorized) - Invalid or missing API token.

Request Schema

FieldTypeDefaultDescription
subjectstringrequiredEmail subject line
namestringUntitledInternal name for the campaign
previewstringoptionalPreview text shown in email clients
contentobjectboilerplateEmail content in TipTap JSON format
contentTypestringMAILYContent type: MAILY, PLATE, or MARKDOWN
senderIdstringautoEmail sender ID (uses default sender if not specified)
replyTostringoptionalReply-to email address

Response Fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
campaignobjectThe created campaign object
campaign.idstringUnique identifier for the campaign
campaign.campaignIdstringSame as id (for consistency)
campaign.namestringName of the campaign
campaign.subjectstringEmail subject line
campaign.previewstring or nullPreview text for the email
campaign.statusstringCampaign status (always DRAFT for new campaigns)
campaign.contentTypestringContent type: MAILY, PLATE, or MARKDOWN
campaign.contentobjectEmail content in TipTap JSON format
campaign.replyTostring or nullReply-to email address
campaign.senderIdstringEmail sender ID
campaign.recipientCountnumberNumber of recipients (0 for new campaigns)
campaign.createdAtstringISO timestamp when the campaign was created
campaign.updatedAtstringISO timestamp when the campaign was last updated
campaignIdstringCampaign ID at the root level for convenience

Content Format

The content field accepts TipTap JSON format. If not provided, a default template is used that includes:

  • A "Hello, world!" paragraph
  • An unsubscribe link (required for email compliance)

Example content structure:

{
  "type": "doc",
  "content": [
    {
      "type": "paragraph",
      "content": [{ "type": "text", "text": "Hello, {{name}}!" }]
    }
  ]
}

Usage Example

Use this API endpoint to:

  • Create campaigns programmatically from your application
  • Set up automated campaign creation workflows
  • Build custom campaign management interfaces
  • Import campaigns from other email marketing tools