Create Campaign
Create a new email campaign in your Lumail account
MethodPOST
/api/v1/campaignshttps://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
| Field | Type | Default | Description |
|---|---|---|---|
subject | string | required | Email subject line |
name | string | Untitled | Internal name for the campaign |
preview | string | optional | Preview text shown in email clients |
content | object | boilerplate | Email content in TipTap JSON format |
contentType | string | MAILY | Content type: MAILY, PLATE, or MARKDOWN |
senderId | string | auto | Email sender ID (uses default sender if not specified) |
replyTo | string | optional | Reply-to email address |
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Indicates if the operation was successful |
campaign | object | The created campaign object |
campaign.id | string | Unique identifier for the campaign |
campaign.campaignId | string | Same as id (for consistency) |
campaign.name | string | Name of the campaign |
campaign.subject | string | Email subject line |
campaign.preview | string or null | Preview text for the email |
campaign.status | string | Campaign status (always DRAFT for new campaigns) |
campaign.contentType | string | Content type: MAILY, PLATE, or MARKDOWN |
campaign.content | object | Email content in TipTap JSON format |
campaign.replyTo | string or null | Reply-to email address |
campaign.senderId | string | Email sender ID |
campaign.recipientCount | number | Number of recipients (0 for new campaigns) |
campaign.createdAt | string | ISO timestamp when the campaign was created |
campaign.updatedAt | string | ISO timestamp when the campaign was last updated |
campaignId | string | Campaign 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
Related Documentation
- List Campaigns - List all campaigns
- Get Campaign - Get details for a specific campaign
- Update Campaign - Update a campaign
- Delete Campaign - Delete a campaign
- Variables - Use subscriber data in campaigns