AI Agents Guide

Everything an AI agent needs to autonomously create accounts, set up newsletters, manage issues, grow subscriber lists, configure custom domains, and audit health — end to end.

Machine-readable formats available:

Quick Start for Agents

  1. Sign up — browser automation at /signup
  2. Confirm email — extract confirmation link from email
  3. Create newsletter — browser automation at /newsletters/new
  4. Complete onboarding — frequency + preferences steps
  5. Generate API key — at /newsletters/:id/api_keys
  6. Use REST API — all subsequent operations via API

Phase 1: Account Creation (Browser Flow)

There is no REST endpoint for signup — use browser automation (Playwright, Puppeteer, Selenium).

Step 1.1 — Register

# Navigate to signup
GET https://www.dailydraft.ai/signup

# Submit form (POST /signup)
{
  "user[email_address]": "[email protected]",
  "user[password]": "SecurePassword123!",
  "user[password_confirmation]": "SecurePassword123!"
}

# On success: redirected to /email_confirmation_pending
# Response includes flash: "Please check your email to confirm your account"

Step 1.2 — Confirm Email

DailyDraft sends a confirmation email. Extract the confirmation URL and navigate to it.

# Confirmation link format:
https://www.dailydraft.ai/email_confirmations/<TOKEN>

# On success: session created, redirected to /newsletters
# Flash: "Email confirmed! Welcome to DailyDraft!"
Confirmation Token Validity: Tokens expire. If expired, navigate to /email_confirmation_required and submit the resend form.

Step 1.3 — Sign In (Existing Accounts)

# Navigate to
GET https://www.dailydraft.ai/session/new

# Submit form (POST /session)
{
  "email_address": "[email protected]",
  "password": "SecurePassword123!"
}

# On success: redirected to /newsletters

Phase 2: Newsletter Creation (Browser Flow)

Step 2.1 — Create Newsletter

# Navigate to
GET https://www.dailydraft.ai/newsletters/new

# Submit form (POST /newsletters)
{
  "newsletter[name]": "AI Stack Weekly",
  "newsletter[tagline]": "Weekly AI tooling for builders",
  "newsletter[keywords]": "artificial intelligence, Claude, Cursor, LLMs",
  "newsletter[from_name]": "Todd Dickerson",
  "newsletter[from_email]": "[email protected]"
}

# On success: redirected to /newsletters/:id/setup_frequency
# Flash: "Newsletter created! Let's set up your publishing schedule..."

Step 2.2 — Set Publishing Frequency

# At: GET /newsletters/:id/setup_frequency
# Submit (POST /newsletters/:id/apply_frequency)
{
  "frequency": "weekly"  # Options: "daily", "three_times", "weekly", "skip"
}

# Frequencies map to:
# "daily"       → Mon-Fri draft pipeline
# "three_times" → Mon/Wed/Fri
# "weekly"      → Tuesdays (recommended starting point)
# "skip"        → Configure later

# On success: redirected to /newsletters/:id/preference/edit

Step 2.3 — Set Preferences

# At: GET /newsletters/:id/preference/edit
# Submit (PATCH /newsletters/:id/preference)
{
  "newsletter_preference[target_audience]": "B2B software developers who use AI tools",
  "newsletter_preference[content_tone]": "professional",
  "newsletter_preference[newsletter_length]": "medium"
}

# On success: redirected to /newsletters/:id
# Newsletter is now live on its subdomain

Phase 3: Generate API Key (Browser Flow)

# Navigate to
GET /newsletters/:id/api_keys/new

# Submit form (POST /newsletters/:id/api_keys)
{
  "api_key[name]": "ea-agent",
  "api_key[permissions][]": "read",
  "api_key[permissions][]": "write"
}

# Response: page shows the full key ONCE — capture it immediately
# Key format: <8-char-prefix><64-char-hex>
# Store securely — it cannot be retrieved again
API Key Visibility: The full key is shown exactly once at creation time. Capture it from the page before navigating away.

Phase 4: REST API Operations

All subsequent operations use the REST API. Set your environment:

BASE=https://www.dailydraft.ai/api/v1
API_KEY=<your_key>

Audit newsletter health

curl -s $BASE/newsletter -H "Authorization: Bearer $API_KEY" | jq '{name,tier,status,from_email}'
curl -s $BASE/newsletter/stats -H "Authorization: Bearer $API_KEY" | jq '.stats'

Create and send an issue

# 1. Create draft
ISSUE=$(curl -s -X POST $BASE/issues \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "issue": {
      "subject": "AI Stack Weekly #1",
      "content_markdown": "## Welcome\n\nThis is issue #1..."
    }
  }')
ISSUE_ID=$(echo $ISSUE | jq -r '.id')

# 2. Approve
curl -s -X PATCH $BASE/issues/$ISSUE_ID \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"issue": {"status": "approved"}}'

# 3. Send (requires paid tier)
curl -s -X POST $BASE/issues/$ISSUE_ID/send_now \
  -H "Authorization: Bearer $API_KEY"

Import subscribers

curl -s -X POST $BASE/subscribers/bulk_create \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subscribers": [{"email": "[email protected]"}]}'

Phase 5: Custom Domain Setup (Browser + DNS)

Custom domains use Cloudflare for SaaS with automated SSL provisioning. No REST API endpoint — use browser automation + DNS management.

  1. Navigate to /newsletters/:id/custom_domains/choose_method
  2. Submit domain name (e.g., newsletter.yourdomain.com)
  3. DailyDraft returns CNAME and optional TXT records to add
  4. Via DNS provider API: add CNAME newsletter.yourdomain.com → <subdomain>.dailydraft.ai
  5. Click Verify — or navigate to POST /newsletters/:id/custom_domains/:domain_id/verify
  6. Poll status at /newsletters/:id/custom_domains/:domain_id until status: "active"
DNS Propagation: Allow up to 24 hours for DNS to propagate. SSL is auto-provisioned by Cloudflare once DNS resolves correctly.

Full Onboarding Checklist (Agent Validation)

Step Method Success Signal
1. Register accountBrowser POST /signupRedirect to /email_confirmation_pending
2. Confirm emailBrowser GET /email_confirmations/:tokenSession created, redirect to /newsletters
3. Create newsletterBrowser POST /newslettersRedirect to /setup_frequency
4. Set frequencyBrowser POST /apply_frequencyRedirect to /preference/edit
5. Set preferencesBrowser PATCH /preferenceRedirect to /newsletters/:id
6. Generate API keyBrowser POST /api_keysFull key shown on page
7. Fetch newsletterAPI GET /newsletter200 with newsletter JSON
8. Create issueAPI POST /issues201 with issue id
9. Approve issueAPI PATCH /issues/:id200, status="approved"
10. Publish to webAPI POST /issues/:id/publish200 with web_url
11. Import subscriberAPI POST /subscribers/bulk_create{ created: N, errors: [] }
12. Verify healthAPI GET /newsletter/statstotal_subscribers > 0

Issue Content Format

Use standard Markdown for content_markdown:

## Opening Hook

One paragraph that makes the reader glad they opened.

---

## 🔥 Main Story: [Headline]

[150-300 words. What happened, why it matters, what to do about it.]

**Source:** [Publication name](https://url)

---

## Quick Hits

- **[Headline]** — One sentence summary. ([Source](url))
- **[Headline]** — One sentence summary. ([Source](url))

---

## Takeaway

One paragraph with your editorial POV.

---

*Forwarded this? [Subscribe free](https://[subdomain].dailydraft.ai/subscribe).*

Error Reference

Code Meaning Fix
401Invalid API keyRegenerate at Settings → API Keys
402Paid tier requiredUpgrade newsletter ($97/mo) before sending email
403Missing permissionUse a key with write or delete scope
422Validation failedCheck errors array in response
429Rate limitedWait until X-RateLimit-Reset timestamp

Rate Limits

LimitValue
Requests per hour1000
Bulk import max1000 subscribers per request
HeadersX-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Machine-Readable Resources

Health Check

curl https://www.dailydraft.ai/up
# → {"status":"ok"}

Related Docs

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