Skip to main content

Query campaigns

curl -u 'username:password' 'https://listmonk.mysite.com/api/campaigns' \
  -G \
  -d 'page=1' \
  -d 'status=running' \
  -d 'query=newsletter'
Retrieves a paginated list of campaigns. Authentication: Required
Permission: campaigns:get_all or campaigns:get

Query Parameters

page
integer
default:"1"
Page number
per_page
integer
default:"20"
Results per page
query
string
Search term to filter campaigns by name
status
string
Filter by status (can be specified multiple times): draft, scheduled, running, paused, finished, cancelled
tag
string
Filter by tag (can be specified multiple times)
order_by
string
default:"created_at"
Field to order by
order
string
default:"desc"
Sort order: asc or desc
no_body
boolean
default:"false"
If true, excludes campaign body from response

Response

data
object

Get campaign

curl -u 'username:password' 'https://listmonk.mysite.com/api/campaigns/1'
Retrieves a single campaign by ID. Authentication: Required
Permission: campaigns:get_all or campaigns:get

Path Parameters

id
integer
required
Campaign ID

Query Parameters

no_body
boolean
default:"false"
If true, excludes body from response

Create campaign

curl -u 'username:password' 'https://listmonk.mysite.com/api/campaigns' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Monthly Newsletter",
    "subject": "Newsletter for {{ .Subscriber.FirstName }}",
    "lists": [1, 2],
    "type": "regular",
    "content_type": "richtext",
    "body": "<p>Hello {{ .Subscriber.FirstName }}!</p>",
    "altbody": "Hello!",
    "from_email": "[email protected]",
    "messenger": "email",
    "template_id": 1,
    "tags": ["newsletter"],
    "send_at": "2024-12-01T10:00:00Z"
  }'
Creates a new campaign in draft status. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Request Body

name
string
required
Campaign name (max 2000 characters)
subject
string
required
Email subject line (supports template variables)
lists
array
required
Array of list IDs to send to
body
string
required
Campaign body content
type
string
default:"regular"
Campaign type: regular or optin
content_type
string
default:"richtext"
Content type: richtext, html, markdown, plain, visual
from_email
string
From email address (defaults to system setting)
altbody
string
Plain text alternative body
send_at
string
ISO 8601 timestamp for scheduled sending (null for immediate)
messenger
string
default:"email"
Messenger backend to use
template_id
integer
Template ID to use
tags
array
Array of tags
headers
array
Custom email headers (array of objects with key-value pairs)
media
array
Array of media IDs to attach

Update campaign

curl -u 'username:password' -X PUT 'https://listmonk.mysite.com/api/campaigns/1' \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "Updated Newsletter",
    "subject": "New Subject",
    "body": "<p>Updated content</p>"
  }'
Updates a campaign. Only campaigns in draft, scheduled, or paused status can be updated. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Path Parameters

id
integer
required
Campaign ID

Request Body

Same fields as create campaign. Only provided fields will be updated.

Update campaign status

curl -u 'username:password' -X PUT 'https://listmonk.mysite.com/api/campaigns/1/status' \
  -H 'Content-Type: application/json' \
  -d '{"status": "running"}'
Changes a campaign’s status to start, pause, or cancel it. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Path Parameters

id
integer
required
Campaign ID

Request Body

status
string
required
New status:
  • running: Start sending the campaign
  • paused: Pause a running campaign
  • scheduled: Schedule a draft campaign
  • cancelled: Cancel a campaign

Update campaign archive settings

curl -u 'username:password' -X PUT 'https://listmonk.mysite.com/api/campaigns/1/archive' \
  -H 'Content-Type: application/json' \
  -d '{
    "archive": true,
    "archive_template_id": 1,
    "archive_slug": "monthly-newsletter-2024-01",
    "archive_meta": {"public": true}
  }'
Configures campaign archiving for public viewing. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Path Parameters

id
integer
required
Campaign ID

Request Body

archive
boolean
required
Enable/disable archiving
archive_template_id
integer
Template ID for archive page
archive_slug
string
Custom URL slug for archive page
archive_meta
object
Custom metadata for archive

Delete campaign

curl -u 'username:password' -X DELETE 'https://listmonk.mysite.com/api/campaigns/1'
Deletes a campaign. Only draft and scheduled campaigns can be deleted. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Path Parameters

id
integer
required
Campaign ID

Delete campaigns (bulk)

curl -u 'username:password' -X DELETE 'https://listmonk.mysite.com/api/campaigns?id=1&id=2'
Deletes multiple campaigns. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Query Parameters

id
integer
Campaign ID (can be specified multiple times)
query
string
Search term
all
boolean
Delete all campaigns

Get running campaign stats

curl -u 'username:password' 'https://listmonk.mysite.com/api/campaigns/running/stats'
Retrieves real-time statistics for currently running campaigns. Authentication: Required
Permission: campaigns:get_all or campaigns:get

Response

data
array
Array of campaign stats with send rates

Preview campaign

curl -u 'username:password' 'https://listmonk.mysite.com/api/campaigns/1/preview'
Previews campaign content with rendered template. Authentication: Required
Permission: campaigns:get_all or campaigns:get

Path Parameters

id
integer
required
Campaign ID

Request Body (POST only)

body
string
Body content to preview
content_type
string
Content type
template_id
integer
Template ID to use

Convert campaign content

curl -u 'username:password' -X POST 'https://listmonk.mysite.com/api/campaigns/1/content' \
  -H 'Content-Type: application/json' \
  -d '{
    "body": "# Markdown Content\n\nHello!",
    "from": "markdown",
    "to": "html"
  }'
Converts campaign content between formats (e.g., Markdown to HTML). Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Path Parameters

id
integer
required
Campaign ID

Request Body

body
string
required
Content to convert
from
string
required
Source format: markdown
to
string
required
Target format: html or richtext

Test campaign

curl -u 'username:password' -X POST 'https://listmonk.mysite.com/api/campaigns/1/test' \
  -H 'Content-Type: application/json' \
  -d '{
    "subscribers": ["[email protected]", "[email protected]"],
    "name": "Test Campaign",
    "subject": "Test Subject",
    "body": "<p>Test body</p>"
  }'
Sends test emails to specified addresses. Authentication: Required
Permission: campaigns:manage_all or campaigns:manage

Path Parameters

id
integer
required
Campaign ID

Request Body

subscribers
array
required
Array of subscriber email addresses to send test to
name
string
Override campaign name
subject
string
Override subject
body
string
Override body
template_id
integer
Override template

Get campaign analytics

curl -u 'username:password' 'https://listmonk.mysite.com/api/campaigns/analytics/views' \
  -G \
  -d 'id=1' \
  -d 'id=2' \
  -d 'from=2024-01-01T00:00:00Z' \
  -d 'to=2024-12-31T23:59:59Z'
Retrieves campaign analytics data. Authentication: Required
Permission: campaigns:get_analytics

Path Parameters

type
string
required
Analytics type: views, clicks, or links

Query Parameters

id
integer
required
Campaign ID (can be specified multiple times)
from
string
required
Start date (ISO 8601)
to
string
required
End date (ISO 8601)

Response

Returns analytics data with timestamps and counts for the specified period.

Build docs developers (and LLMs) love