Update Campaign

Update an existing campaign by ID

MethodPATCH
/api/v1/campaigns/{campaignId}

https://lumail.io/api/v1/campaigns/{campaignId}

Update an existing campaign's metadata and content. Only campaigns with DRAFT status can be updated. For scheduled campaigns, cancel the schedule first.

Response

  • Success (200 OK) - Returns the updated campaign object.
  • Error (400 Bad Request) - Campaign is not in DRAFT status or invalid sender ID.
  • Error (404 Not Found) - Campaign not found or doesn't belong to your organization.
  • Error (401 Unauthorized) - Invalid or missing API token.

Path Parameters

ParameterTypeDescription
campaignIdstringRequired. The unique campaign ID

Request Schema

FieldTypeDescription
namestringInternal name for the campaign
subjectstringEmail subject line
previewstringPreview text shown in email clients
contentobjectEmail content in TipTap JSON format
contentTypestringContent type: MAILY, PLATE, or MARKDOWN
senderIdstringEmail sender ID
replyTostringReply-to email address

All fields are optional. Only provided fields will be updated.

Response Fields

FieldTypeDescription
successbooleanIndicates if the operation was successful
campaignobjectThe updated 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 (DRAFT)
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
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

Important Notes

  • Only DRAFT campaigns can be updated. Scheduled, sending, or sent campaigns cannot be modified.
  • To update a scheduled campaign, you must first cancel the schedule using the Lumail UI.
  • When updating the senderId, the sender must exist and belong to your organization.

Usage Example

Use this API endpoint to:

  • Update campaign subject lines and preview text
  • Modify email content programmatically
  • Change the sender for a campaign
  • Build campaign editing interfaces
  • Sync campaign updates from external systems