Newsletter API

Get and update newsletter settings via the API.

Endpoints

Method Endpoint Description
GET /newsletter Get newsletter details
PATCH /newsletter Update newsletter settings
GET /newsletter/stats Get newsletter statistics
Note: The API key determines which newsletter is accessed. You don't need to specify a newsletter ID.

Get Newsletter

GET /api/v1/newsletter

Response

{
  "data": {
    "id": 1,
    "name": "Tech Weekly",
    "tagline": "Your weekly dose of tech news",
    "sender_name": "Tech Weekly Team",
    "sender_email": "[email protected]",
    "subdomain": "tech-weekly",
    "status": "active",
    "tier": "paid",
    "subscriber_count": 1500,
    "issue_count": 42,
    "created_at": "2024-06-15T12:00:00Z",
    "updated_at": "2025-01-10T12:00:00Z",
    "urls": {
      "home": "https://tech-weekly.dailydraft.ai",
      "subscribe": "https://tech-weekly.dailydraft.ai/subscribe",
      "archive": "https://tech-weekly.dailydraft.ai/archive"
    }
  }
}

Update Newsletter

PATCH /api/v1/newsletter

Request Body

{
  "name": "Tech Weekly Digest",
  "tagline": "The best tech news, every week",
  "sender_name": "Tech Weekly"
}

Updatable Fields

Field Type Description
name string Newsletter name
tagline string Short description
sender_name string "From" name in emails
sender_email string "From" email address
Note: Some fields like subdomain and tier cannot be changed via API.

Get Statistics

GET /api/v1/newsletter/stats

Response

{
  "data": {
    "subscribers": {
      "total": 1500,
      "active": 1450,
      "unsubscribed": 45,
      "bounced": 5,
      "growth_last_30_days": 120
    },
    "issues": {
      "total": 42,
      "sent_last_30_days": 4
    },
    "engagement": {
      "average_open_rate": 32.5,
      "average_click_rate": 8.2,
      "last_30_days": {
        "emails_sent": 5800,
        "opens": 1885,
        "clicks": 476
      }
    },
    "top_issues": [
      {
        "id": 40,
        "subject": "AI Revolution",
        "open_rate": 45.2,
        "click_rate": 12.3
      },
      {
        "id": 38,
        "subject": "Tech Layoffs Update",
        "open_rate": 42.1,
        "click_rate": 10.8
      }
    ]
  }
}

Metrics Explained

Metric Description
open_rate Percentage of delivered emails that were opened
click_rate Percentage of delivered emails with at least one click
growth_last_30_days Net new subscribers (new - unsubscribed)

Newsletter Status Values

Status Description
active Newsletter is active and can send
paused Sending is temporarily paused
cancelled Subscription cancelled, read-only

Newsletter Tier Values

Tier Description
free Free tier (preview only, no sending)
pending Payment pending
paid Paid tier (full features)

Still need help?

Can't find what you're looking for? Chat with our AI assistant or create a support ticket.

Sign in to get support