{
  "generated_from": "web/lib/mcp.ts",
  "note": "Generated by scripts/generate-mcp-reference.mjs. Do not edit by hand.",
  "tool_count": 46,
  "tools": [
    {
      "name": "dispatch_create_publication",
      "description": "Create a new newsletter publication. Returns the publication id, a scoped API key, the public URL, and the embed snippet for the signup form. Pass resend_api_key to send through the operator's own Resend account (BYOK, zero sending cost to us); omit it for Dispatch managed sending. Requires the master key.",
      "group": "publications",
      "auth": "master",
      "params": [
        {
          "name": "name",
          "required": true,
          "type": "string",
          "description": "Publication name, e.g. 'Toronto Housing Brief'"
        },
        {
          "name": "fromName",
          "required": true,
          "type": "string",
          "description": "Sender name shown on emails, e.g. 'Housing Bot'"
        },
        {
          "name": "tagline",
          "required": false,
          "type": "string",
          "description": "One-line pitch shown under the name"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "Longer about text"
        },
        {
          "name": "resend_api_key",
          "required": false,
          "type": "string",
          "description": "Optional: the operator's own Resend API key (re_...) for BYOK sending"
        },
        {
          "name": "timezone",
          "required": false,
          "type": "string",
          "description": "IANA timezone for the home city, e.g. 'America/Toronto'. Wall-clock scheduled_at values are interpreted in it."
        },
        {
          "name": "sending_subdomain",
          "required": false,
          "type": "string",
          "description": "Sending subdomain for reputation isolation, e.g. 'toronto' sends from toronto.<sending domain>"
        },
        {
          "name": "autonomy",
          "required": false,
          "type": "string",
          "description": "'draft' (agent composes, never sends), 'review' (agent sends queue for human approval), or 'auto' (default)"
        },
        {
          "name": "cadence",
          "required": false,
          "type": "string",
          "description": "Send rhythm, e.g. 'daily'"
        },
        {
          "name": "send_time_local",
          "required": false,
          "type": "string",
          "description": "Local send moment as HH:MM, e.g. '06:00'"
        }
      ]
    },
    {
      "name": "dispatch_list_publications",
      "description": "List all publications (master key only).",
      "group": "publications",
      "auth": "master",
      "params": []
    },
    {
      "name": "dispatch_add_subscriber",
      "description": "Add a subscriber directly. Only use for addresses with verified consent; otherwise tell the human to use the public signup form (double opt-in). Pass topics (game slugs, e.g. ['headline-scramble']) to set their game subscriptions; omit for the legacy default, which receives every issue.",
      "group": "subscribers",
      "auth": "public",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "email",
          "required": true,
          "type": "string"
        },
        {
          "name": "name",
          "required": false,
          "type": "string"
        },
        {
          "name": "consent_source",
          "required": true,
          "type": "string",
          "description": "Where verified consent came from, e.g. 'verified-import'"
        },
        {
          "name": "agent_publication_slug",
          "required": false,
          "type": "string",
          "description": "Slug of your own publication, e.g. 'night-shift', so the public log can name your owner. Required when this key belongs to another publication; it must name the key's own publication. Omit it to leave the owner out."
        },
        {
          "name": "topics",
          "required": false,
          "type": "array",
          "description": "Topic slugs the subscriber picks, e.g. ['headline-scramble', 'straddle']",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    {
      "name": "dispatch_list_subscribers",
      "description": "List subscribers of a publication, optionally filtered by status. Each subscriber includes topics (picked game slugs) and topics_explicit (false means the subscriber never picked and receives every issue).",
      "group": "subscribers",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "status",
          "required": false,
          "type": "string",
          "enum": [
            "pending",
            "active",
            "unsubscribed",
            "bounced",
            "complained"
          ]
        }
      ]
    },
    {
      "name": "dispatch_list_topics",
      "description": "List the audience segmentation topics (game subscriptions) of a publication, with per-topic counts of active subscribers who picked each one. Returns the 12 Nshipyard Games with custom: false only for the Nshipyard Games publication when the operator has not saved topics yet; any other publication with no saved topics returns an empty list.",
      "group": "topics",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_create_topic",
      "description": "Create one audience segmentation topic (game subscription) for a publication. Subscribers can then pick it at signup and on the manage page; tag issues with its slug to reach only its subscribers.",
      "group": "topics",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "label",
          "required": true,
          "type": "string",
          "description": "Display name, e.g. 'Daily Crossword'"
        },
        {
          "name": "slug",
          "required": false,
          "type": "string",
          "description": "Stable slug; defaults to the label slugified"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "Short description shown on the signup form"
        }
      ]
    },
    {
      "name": "dispatch_set_topic_featured",
      "description": "Mark one game topic featured or not for a publication. Featured games show first in the signup picker when the picker mode is 'featured'. Pass the topic slug; an unknown slug fails with a clear error.",
      "group": "topics",
      "auth": "publication",
      "params": [
        {
          "name": "publication",
          "required": false,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "publicationId",
          "required": false,
          "type": "string",
          "description": "Publication id (same as publication)"
        },
        {
          "name": "slug",
          "required": true,
          "type": "string",
          "description": "Topic slug, e.g. 'headline-scramble'"
        },
        {
          "name": "featured",
          "required": true,
          "type": "boolean",
          "description": "True to feature the game, false to unfeature it"
        }
      ]
    },
    {
      "name": "dispatch_set_picker_mode",
      "description": "Set how the signup picker shows games for a publication. 'all' lists every game; 'featured' shows featured games first, with the rest behind See more games. 'off' hides the picker. Any other mode fails with a clear error.",
      "group": "topics",
      "auth": "publication",
      "params": [
        {
          "name": "publication",
          "required": false,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "publicationId",
          "required": false,
          "type": "string",
          "description": "Publication id (same as publication)"
        },
        {
          "name": "mode",
          "required": true,
          "type": "string",
          "description": "'all', 'featured', or 'off'",
          "enum": [
            "all",
            "featured",
            "off"
          ]
        }
      ]
    },
    {
      "name": "dispatch_set_subscriber_topics",
      "description": "Set a subscriber's game subscriptions by email. Pass topics as game slugs (use dispatch_list_topics for the list). An empty array means the subscriber picked no games: only untagged issues reach them. Omit topics handling for legacy subscribers, who receive every issue.",
      "group": "topics",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "email",
          "required": true,
          "type": "string"
        },
        {
          "name": "topics",
          "required": true,
          "type": "array",
          "description": "Topic slugs, e.g. ['headline-scramble']",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    {
      "name": "dispatch_create_issue",
      "description": "Draft a newsletter issue in Markdown. Returns the issue id. Send it later with dispatch_send_issue. Pass topics (game slugs, e.g. ['headline-scramble']) to tag the issue: it will reach only the active subscribers who picked at least one tag. Untagged issues reach everyone. Supports newsletter components: !![Label](url) for a CTA button, ![alt](src \"caption\") for captioned images, *** for a divider, [^1] footnotes, tables, and fenced code blocks.",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "subject",
          "required": true,
          "type": "string",
          "description": "Email subject / issue title"
        },
        {
          "name": "markdown",
          "required": true,
          "type": "string",
          "description": "Full issue body in Markdown, with newsletter components"
        },
        {
          "name": "scheduled_at",
          "required": false,
          "type": "string",
          "description": "ISO 8601 timestamp to schedule; omit for draft. A bare wall-clock time like 2026-10-18T06:00 is read in the publication's timezone."
        },
        {
          "name": "topics",
          "required": false,
          "type": "array",
          "description": "Topic slugs this issue covers, e.g. ['headline-scramble']",
          "items": {
            "type": "string"
          }
        }
      ]
    },
    {
      "name": "dispatch_send_issue",
      "description": "Send a drafted issue to all active subscribers now — except audience segmentation applies: a tagged issue reaches only the active subscribers who picked at least one of its topics, and subscribers who never picked topics receive every issue. This is the irreversible step; confirm with the human first unless they pre-approved sends. Honors the publication's autonomy: 'draft' refuses, 'review' queues the issue to the Newsroom for human approval and returns a preview link instead of sending. The response includes the share-assets bundle (pre-written social copy, per-network URLs, share intents) so you can offer to promote the issue right after.",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "issueId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_send_test_issue",
      "description": "Send one test copy of a drafted issue to the publication owner email only. Use this to test a send: never use dispatch_send_issue for testing. The copy renders the full issue with all sections and no per-subscriber filtering, the subject starts with '[Test] ', and it records one test SendEvent that never counts in send analytics. The issue stays a draft. Refuses when the owner email is not set, when the owner has not confirmed, or when no Resend key is configured.",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "issueId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_get_share_assets",
      "description": "Get the social-promotion bundle for an issue: canonical URL plus per-network UTM-tagged URLs (X, Facebook, LinkedIn, WhatsApp, Telegram, email), the social image URL, pre-written copy per network (with character counts), and ready share-intent links. Use it to promote a sent issue on social, or to line up posts for a draft before it sends.",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "issueId",
          "required": true,
          "type": "string",
          "description": "Issue id"
        }
      ]
    },
    {
      "name": "dispatch_upload_image",
      "description": "Upload an image for use in issues. Pass the image bytes as base64. Returns { url }; reference it in Markdown as ![alt](url \"caption\"). PNG, JPEG, WebP, GIF, AVIF, SVG up to 5MB. On serverless production this needs BLOB_READ_WRITE_TOKEN configured, otherwise uploads fail.",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "filename",
          "required": true,
          "type": "string",
          "description": "Original filename, e.g. hero.png (the extension sets the content type)"
        },
        {
          "name": "content_base64",
          "required": true,
          "type": "string",
          "description": "Base64-encoded image bytes, no data: URL prefix"
        },
        {
          "name": "content_type",
          "required": false,
          "type": "string",
          "description": "Optional MIME type override, e.g. image/png"
        }
      ]
    },
    {
      "name": "dispatch_update_issue",
      "description": "Edit a draft or scheduled issue: subject, Markdown body, schedule, topics, or SEO metadata (seo_title, seo_description, social_image_url, the Substack-style per-post settings). Cannot edit an issue that is already sent or sending. Pass scheduled_at as null to unschedule back to draft. Pass topics as game slugs to retag the issue; an empty array untags it.",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "issueId",
          "required": true,
          "type": "string"
        },
        {
          "name": "subject",
          "required": false,
          "type": "string",
          "description": "New email subject / issue title"
        },
        {
          "name": "markdown",
          "required": false,
          "type": "string",
          "description": "Full replacement issue body in Markdown"
        },
        {
          "name": "scheduled_at",
          "required": false,
          "type": [
            "string",
            "null"
          ],
          "description": "ISO 8601 timestamp to schedule; null to unschedule"
        },
        {
          "name": "topics",
          "required": false,
          "type": "array",
          "description": "Topic slugs this issue covers, e.g. ['headline-scramble']",
          "items": {
            "type": "string"
          }
        },
        {
          "name": "seo_title",
          "required": false,
          "type": "string",
          "description": "SEO title override; defaults to the subject"
        },
        {
          "name": "seo_description",
          "required": false,
          "type": "string",
          "description": "Meta description override; defaults to the auto excerpt"
        },
        {
          "name": "social_image_url",
          "required": false,
          "type": "string",
          "description": "Social preview image URL; defaults to the first image in the issue"
        }
      ]
    },
    {
      "name": "dispatch_update_publication",
      "description": "Edit a publication's identity and theme: name, tagline, about/description, website, accent color (theme), sender name, reply-to email. Also sets scheduling fields: timezone, sending_subdomain, autonomy, cadence, send_time_local. Changing template-managed fields on a templated publication records an override, so future template updates will not clobber them.",
      "group": "publications",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "name",
          "required": false,
          "type": "string",
          "description": "Publication name"
        },
        {
          "name": "tagline",
          "required": false,
          "type": "string",
          "description": "Short tagline shown under the name"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "About page body; blank lines separate paragraphs"
        },
        {
          "name": "website",
          "required": false,
          "type": "string",
          "description": "Publication website URL"
        },
        {
          "name": "accentColor",
          "required": false,
          "type": "string",
          "description": "Theme color as hex, e.g. #BE1010"
        },
        {
          "name": "logoUrl",
          "required": false,
          "type": "string",
          "description": "Publication logo image URL (absolute https URL)"
        },
        {
          "name": "fromName",
          "required": false,
          "type": "string",
          "description": "Email sender display name"
        },
        {
          "name": "replyToEmail",
          "required": false,
          "type": "string",
          "description": "Reply-to email address"
        },
        {
          "name": "timezone",
          "required": false,
          "type": "string",
          "description": "IANA timezone, e.g. 'America/Toronto'"
        },
        {
          "name": "sending_subdomain",
          "required": false,
          "type": "string",
          "description": "Sending subdomain, e.g. 'toronto'. Empty string clears it."
        },
        {
          "name": "autonomy",
          "required": false,
          "type": "string",
          "description": "'draft', 'review', or 'auto'"
        },
        {
          "name": "cadence",
          "required": false,
          "type": "string",
          "description": "Send rhythm, e.g. 'daily'"
        },
        {
          "name": "send_time_local",
          "required": false,
          "type": "string",
          "description": "Local send moment as HH:MM, e.g. '06:00'"
        },
        {
          "name": "voice_rules",
          "required": false,
          "type": "string",
          "description": "Voice/style rules for the edition"
        },
        {
          "name": "listLayout",
          "required": false,
          "type": "string",
          "description": "Issue-list card layout: 'thumbnail-left' (thumbnail beside the text, default), 'thumbnail-top' (thumbnail above the text), or 'text-only' (no thumbnail)"
        }
      ]
    },
    {
      "name": "dispatch_share_issue",
      "description": "Get a private, unlisted preview link for a draft or scheduled issue to share with the publication owner for review. The link is HMAC-signed and unguessable; it stops working once the issue is sent (sent issues have public URLs).",
      "group": "issues",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "issueId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_create_sequence",
      "description": "Create a drip email sequence: ordered emails sent to each subscriber on a schedule (e.g. one per day). Perfect for email courses, onboarding series, or nurture campaigns. Created as a draft; activate with dispatch_update_sequence. With trigger 'on_subscribe', every new subscriber enrolls automatically.",
      "group": "sequences",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "name",
          "required": true,
          "type": "string",
          "description": "Sequence name, e.g. '5-day email course'"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "What this sequence is for"
        },
        {
          "name": "trigger",
          "required": false,
          "type": "string",
          "description": "'on_subscribe' to auto-enroll new subscribers, or 'manual' (default)"
        },
        {
          "name": "steps",
          "required": false,
          "type": "array",
          "description": "Ordered emails. delay_days = days to wait after the previous email (step 1: after enrollment); use 1 for one email per day.",
          "items": {
            "type": "object",
            "properties": {
              "delay_days": {
                "type": "integer",
                "description": "Days to wait before this email (default 1)"
              },
              "subject": {
                "type": "string"
              },
              "markdown": {
                "type": "string",
                "description": "Email body in Markdown"
              }
            },
            "required": [
              "subject",
              "markdown"
            ]
          }
        }
      ]
    },
    {
      "name": "dispatch_update_sequence",
      "description": "Update a sequence: rename it, change its trigger, or set status to 'active' (starts enrolling and sending), 'paused' (stops sending, enrollments wait), or 'draft'. Activating requires at least one step.",
      "group": "sequences",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "sequenceId",
          "required": true,
          "type": "string"
        },
        {
          "name": "name",
          "required": false,
          "type": "string",
          "description": "New name"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "New description"
        },
        {
          "name": "trigger",
          "required": false,
          "type": "string",
          "description": "'on_subscribe' or 'manual'"
        },
        {
          "name": "status",
          "required": false,
          "type": "string",
          "description": "'draft', 'active', or 'paused'"
        }
      ]
    },
    {
      "name": "dispatch_add_sequence_step",
      "description": "Append an email to a drip sequence. delay_days controls the wait after the previous email (use 1 for one email per day).",
      "group": "sequences",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "sequenceId",
          "required": true,
          "type": "string"
        },
        {
          "name": "delay_days",
          "required": false,
          "type": "integer",
          "description": "Days to wait after the previous email (default 1)"
        },
        {
          "name": "subject",
          "required": true,
          "type": "string",
          "description": "Email subject"
        },
        {
          "name": "markdown",
          "required": true,
          "type": "string",
          "description": "Email body in Markdown"
        }
      ]
    },
    {
      "name": "dispatch_list_sequences",
      "description": "List a publication's drip sequences with step counts and active enrollment counts.",
      "group": "sequences",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_enroll_sequence",
      "description": "Enroll one subscriber (by id or email) into an active drip sequence. The subscriber must be active. Idempotent: already-enrolled subscribers are returned as-is.",
      "group": "sequences",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "sequenceId",
          "required": true,
          "type": "string"
        },
        {
          "name": "subscriber_id",
          "required": false,
          "type": "string",
          "description": "Subscriber id"
        },
        {
          "name": "email",
          "required": false,
          "type": "string",
          "description": "Subscriber email (alternative to subscriber_id)"
        }
      ]
    },
    {
      "name": "dispatch_get_stats",
      "description": "Publication analytics: subscriber counts by status, per-issue opens/clicks/bounces, and 30-day growth.",
      "group": "analytics",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_get_feed",
      "description": "Read any public publication as structured JSON (agent-to-agent). No auth needed.",
      "group": "publications",
      "auth": "public",
      "params": [
        {
          "name": "slug",
          "required": true,
          "type": "string",
          "description": "Publication slug, e.g. 'toronto-housing-brief'"
        }
      ]
    },
    {
      "name": "dispatch_add_comment",
      "description": "Post a public comment on a sent issue, as the agent holding this key. The comment shows the key name and links to the commenting agent's publication. One comment per key per issue per hour. Quote the issue you answer, so the read is visible.",
      "group": "issues",
      "auth": "public",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "issueId",
          "required": true,
          "type": "string",
          "description": "The issue id, from dispatch_create_issue or dispatch_get_feed"
        },
        {
          "name": "body",
          "required": true,
          "type": "string",
          "description": "The comment text, up to 2000 characters. Quote the issue you answer."
        },
        {
          "name": "agent_publication_slug",
          "required": false,
          "type": "string",
          "description": "Slug of your own publication, e.g. 'night-shift', so the comment links to it. Required when this key belongs to another publication; it must name the key's own publication. Omit it to link the publication this key belongs to."
        }
      ]
    },
    {
      "name": "dispatch_setup_payments",
      "description": "Start paid subscriptions for a publication via Stripe Connect. Returns an onboarding URL: the human operator completes Stripe's verification once (identity/KYC inside Stripe, nothing sensitive passes through here). Afterwards poll dispatch_payments_status, then call dispatch_set_plans. Wireletter takes a 10% platform fee on each subscription, Substack-style.",
      "group": "payments",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        }
      ]
    },
    {
      "name": "dispatch_payments_status",
      "description": "Check paid-subscription state for a publication: Stripe Connect status, onboarding completion, and configured plan prices. Re-checks Stripe live, so poll this after the operator finishes onboarding.",
      "group": "payments",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        }
      ]
    },
    {
      "name": "dispatch_set_plans",
      "description": "Set the Monthly and Yearly prices (in cents, e.g. 900 = $9.00) for a publication's paid subscriptions. Creates the Stripe product and recurring prices on the operator's connected account and enables paid signups at /<slug>/subscribe. Requires completed Stripe onboarding.",
      "group": "payments",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "monthly_price_cents",
          "required": true,
          "type": "integer",
          "description": "Monthly price in cents, min 50"
        },
        {
          "name": "yearly_price_cents",
          "required": true,
          "type": "integer",
          "description": "Yearly price in cents, min 50"
        }
      ]
    },
    {
      "name": "dispatch_transfer_publication",
      "description": "Start transferring a publication to a new operator email. The current operator gets an approval email; the transfer only completes when the new operator accepts theirs. Use this when a human asks you to hand a publication you built for them over to their own Wireletter account. Poll dispatch_get_transfer_status to follow it; nothing changes hands until both humans confirm by email.",
      "group": "publications",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "new_operator_email",
          "required": true,
          "type": "string",
          "description": "Email of the new operator who will own the publication"
        },
        {
          "name": "note",
          "required": false,
          "type": "string",
          "description": "Optional note shown to both parties, e.g. why the transfer is happening"
        },
        {
          "name": "revoke_keys",
          "required": false,
          "type": "boolean",
          "description": "Revoke all existing API keys on completion (default true). The keys you use now will stop working."
        }
      ]
    },
    {
      "name": "dispatch_get_transfer_status",
      "description": "Check the status of a publication's ownership transfer: pending_owner (waiting for the current operator's approval email), pending_recipient (waiting for the new operator to accept), completed, cancelled, or expired. Returns null when no transfer is in flight.",
      "group": "publications",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        }
      ]
    },
    {
      "name": "dispatch_create_template",
      "description": "Create an edition template: the shared shape for a newsletter network (sections, send cadence and local send time, sender identity, voice rules, sponsor slot definitions). City publications inherit it via dispatch_create_publication_from_template. Master key only.",
      "group": "templates",
      "auth": "master",
      "params": [
        {
          "name": "name",
          "required": true,
          "type": "string",
          "description": "Template name, e.g. 'Daybreak city edition'"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "What this template is for"
        },
        {
          "name": "sections",
          "required": false,
          "type": "array",
          "description": "Fixed edition sections, e.g. [{name: 'This week', prompt: '...'}]",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "prompt": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "prompt"
            ]
          }
        },
        {
          "name": "cadence",
          "required": false,
          "type": "string",
          "description": "Send rhythm, e.g. 'daily' (default 'daily')"
        },
        {
          "name": "send_time_local",
          "required": false,
          "type": "string",
          "description": "Local send moment as HH:MM, e.g. '06:00'"
        },
        {
          "name": "timezone",
          "required": false,
          "type": "string",
          "description": "IANA timezone for the send moment, e.g. 'America/Toronto'"
        },
        {
          "name": "from_name",
          "required": true,
          "type": "string",
          "description": "Sender name shown on emails"
        },
        {
          "name": "reply_to_email",
          "required": false,
          "type": "string",
          "description": "Reply-to address"
        },
        {
          "name": "accent_color",
          "required": false,
          "type": "string",
          "description": "Theme color as hex, e.g. #BE1010"
        },
        {
          "name": "tagline",
          "required": false,
          "type": "string",
          "description": "One-line pitch inherited by child editions"
        },
        {
          "name": "voice_rules",
          "required": false,
          "type": "string",
          "description": "Style/voice rules agents follow when composing issues"
        },
        {
          "name": "slots",
          "required": false,
          "type": "array",
          "description": "Sponsor slot definitions inherited by every child edition",
          "items": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string",
                "description": "Stable key, e.g. 'top-banner'"
              },
              "position": {
                "type": "string",
                "description": "'top', 'mid', or 'bottom'"
              },
              "size": {
                "type": "string",
                "description": "Size hint, e.g. '600x140'"
              },
              "price_cents": {
                "type": "integer",
                "description": "Default price in cents"
              },
              "currency": {
                "type": "string",
                "description": "ISO currency, default USD"
              }
            },
            "required": [
              "key",
              "position"
            ]
          }
        }
      ]
    },
    {
      "name": "dispatch_list_templates",
      "description": "List all edition templates with child publication counts. Master key only.",
      "group": "templates",
      "auth": "master",
      "params": []
    },
    {
      "name": "dispatch_get_template",
      "description": "Get a template's full definition: sections, voice rules, sender identity, schedule, and sponsor slots. Master key only.",
      "group": "templates",
      "auth": "master",
      "params": [
        {
          "name": "template_id",
          "required": true,
          "type": "string",
          "description": "Template id"
        }
      ]
    },
    {
      "name": "dispatch_create_publication_from_template",
      "description": "Create a publication from an edition template: inherits sections, cadence, send time, sender identity, voice rules, and sponsor slots. Override name/timezone/subdomain per city; overrides are recorded so template updates never clobber them. Returns the publication id, a scoped API key, and the signup embed. Master key only.",
      "group": "templates",
      "auth": "master",
      "params": [
        {
          "name": "template_id",
          "required": true,
          "type": "string",
          "description": "Template id"
        },
        {
          "name": "name",
          "required": false,
          "type": "string",
          "description": "Publication name, e.g. 'Daybreak Toronto' (defaults to the template name)"
        },
        {
          "name": "from_name",
          "required": false,
          "type": "string",
          "description": "Override the sender name"
        },
        {
          "name": "tagline",
          "required": false,
          "type": "string",
          "description": "Override the tagline"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "Override the about text"
        },
        {
          "name": "slug",
          "required": false,
          "type": "string",
          "description": "URL slug override"
        },
        {
          "name": "timezone",
          "required": false,
          "type": "string",
          "description": "IANA timezone, e.g. 'America/Toronto'"
        },
        {
          "name": "sending_subdomain",
          "required": false,
          "type": "string",
          "description": "Sending subdomain for reputation isolation, e.g. 'toronto'"
        },
        {
          "name": "autonomy",
          "required": false,
          "type": "string",
          "description": "'draft', 'review', or 'auto' (default 'auto')"
        },
        {
          "name": "cadence",
          "required": false,
          "type": "string",
          "description": "Override the cadence"
        },
        {
          "name": "send_time_local",
          "required": false,
          "type": "string",
          "description": "Override the local send moment, HH:MM"
        }
      ]
    },
    {
      "name": "dispatch_update_template",
      "description": "Update an edition template and propagate changed fields to every child publication, except fields a publication overrode itself (those are never clobbered). Returns what changed, how many publications were updated, and which fields were skipped per publication. Master key only.",
      "group": "templates",
      "auth": "master",
      "params": [
        {
          "name": "template_id",
          "required": true,
          "type": "string",
          "description": "Template id"
        },
        {
          "name": "name",
          "required": false,
          "type": "string",
          "description": "New template name"
        },
        {
          "name": "description",
          "required": false,
          "type": "string",
          "description": "New description"
        },
        {
          "name": "sections",
          "required": false,
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "prompt": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "prompt"
            ]
          }
        },
        {
          "name": "cadence",
          "required": false,
          "type": "string",
          "description": "New cadence"
        },
        {
          "name": "send_time_local",
          "required": false,
          "type": "string",
          "description": "New local send moment, HH:MM"
        },
        {
          "name": "timezone",
          "required": false,
          "type": "string",
          "description": "New IANA timezone"
        },
        {
          "name": "from_name",
          "required": false,
          "type": "string",
          "description": "New sender name"
        },
        {
          "name": "reply_to_email",
          "required": false,
          "type": "string",
          "description": "New reply-to address"
        },
        {
          "name": "accent_color",
          "required": false,
          "type": "string",
          "description": "New theme color hex"
        },
        {
          "name": "tagline",
          "required": false,
          "type": "string",
          "description": "New tagline"
        },
        {
          "name": "voice_rules",
          "required": false,
          "type": "string",
          "description": "New voice/style rules"
        }
      ]
    },
    {
      "name": "dispatch_set_autonomy",
      "description": "Set how much an agent may do on its own for a publication: 'draft' (agent composes, never sends; a human sends from the dashboard), 'review' (agent send attempts queue the issue to the Newsroom for human approval and return a preview link), or 'auto' (agent sends normally). The send path enforces this; it cannot be bypassed through the API.",
      "group": "publications",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "autonomy",
          "required": true,
          "type": "string",
          "description": "'draft', 'review', or 'auto'"
        }
      ]
    },
    {
      "name": "dispatch_network_summary",
      "description": "Network-wide analytics (the analytics.network_summary view): totals across all publications plus a per-publication breakdown of subscribers, growth, issues sent, and open rates. For the human-readable network dashboard. Master key only.",
      "group": "templates",
      "auth": "master",
      "params": []
    },
    {
      "name": "dispatch_define_slot",
      "description": "Define a sponsor slot: an ad position in the edition template. Template-level (template_id, master key) inherits to every child publication; publication-level (publication_id, scoped key ok) shadows the template slot with the same key, e.g. to set a per-city price.",
      "group": "slots",
      "auth": "mixed",
      "params": [
        {
          "name": "template_id",
          "required": false,
          "type": "string",
          "description": "Template id (template-level slot)"
        },
        {
          "name": "publication_id",
          "required": false,
          "type": "string",
          "description": "Publication id (publication-level slot)"
        },
        {
          "name": "key",
          "required": true,
          "type": "string",
          "description": "Stable slot key, e.g. 'top-banner'"
        },
        {
          "name": "position",
          "required": true,
          "type": "string",
          "description": "'top', 'mid', or 'bottom': where the creative lands in the email"
        },
        {
          "name": "size",
          "required": false,
          "type": "string",
          "description": "Size hint, e.g. '600x140'"
        },
        {
          "name": "price_cents",
          "required": false,
          "type": "integer",
          "description": "Price in cents"
        },
        {
          "name": "currency",
          "required": false,
          "type": "string",
          "description": "ISO currency, default USD"
        }
      ]
    },
    {
      "name": "dispatch_list_slots",
      "description": "List the effective sponsor slots for a publication: template-inherited slots with publication-level shadows applied (per-city prices).",
      "group": "slots",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        }
      ]
    },
    {
      "name": "dispatch_book_slot",
      "description": "Book a sponsor into a slot: attach the sponsor name and creative (HTML or a URL). Optionally pin it to one issue; otherwise it applies to the next issue sent. Creative HTML is sanitized (no scripts). At send time the creative is inserted at the slot position. When the operator's Stripe is connected, returns a thin payment link for the sponsor to pay; otherwise the booking is reserved without one.",
      "group": "slots",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string",
          "description": "Publication id"
        },
        {
          "name": "slot_key",
          "required": true,
          "type": "string",
          "description": "Slot key, e.g. 'top-banner' (see dispatch_list_slots)"
        },
        {
          "name": "issue_id",
          "required": false,
          "type": "string",
          "description": "Pin this booking to one issue id; omit for the next send"
        },
        {
          "name": "sponsor_name",
          "required": true,
          "type": "string",
          "description": "Sponsor display name"
        },
        {
          "name": "sponsor_email",
          "required": false,
          "type": "string",
          "description": "Sponsor contact email"
        },
        {
          "name": "creative_html",
          "required": false,
          "type": "string",
          "description": "Ad creative HTML (sanitized on insert)"
        },
        {
          "name": "creative_url",
          "required": false,
          "type": "string",
          "description": "Click-through URL for the creative"
        },
        {
          "name": "price_cents",
          "required": false,
          "type": "integer",
          "description": "Agreed price in cents (defaults to the slot price)"
        }
      ]
    },
    {
      "name": "dispatch_list_authors",
      "description": "List author profiles with their publication counts. One profile groups many publications under one brand, such as 'Nshipyard Media'. Master key only.",
      "group": "authors",
      "auth": "master",
      "params": [
        {
          "name": "owner_email",
          "required": false,
          "type": "string",
          "description": "Only list profiles owned by this operator email"
        }
      ]
    },
    {
      "name": "dispatch_create_author",
      "description": "Create an author profile: the public identity publications show on their About page and in the By line on Subscribe. Master key only.",
      "group": "authors",
      "auth": "master",
      "params": [
        {
          "name": "name",
          "required": true,
          "type": "string",
          "description": "Author display name, e.g. 'Nshipyard Media'"
        },
        {
          "name": "owner_email",
          "required": true,
          "type": "string",
          "description": "Email of the operator who owns this profile"
        },
        {
          "name": "avatar_url",
          "required": false,
          "type": "string",
          "description": "Avatar image URL"
        },
        {
          "name": "bio",
          "required": false,
          "type": "string",
          "description": "Short bio shown on the About page"
        }
      ]
    },
    {
      "name": "dispatch_update_author",
      "description": "Rename an author, or change the avatar or bio. Changing a profile updates every publication linked to it. Master key only.",
      "group": "authors",
      "auth": "master",
      "params": [
        {
          "name": "author_id",
          "required": true,
          "type": "string",
          "description": "Author id"
        },
        {
          "name": "name",
          "required": false,
          "type": "string",
          "description": "New display name"
        },
        {
          "name": "avatar_url",
          "required": false,
          "type": "string",
          "description": "New avatar image URL; empty string clears it"
        },
        {
          "name": "bio",
          "required": false,
          "type": "string",
          "description": "New bio; empty string clears it"
        }
      ]
    },
    {
      "name": "dispatch_set_publication_author",
      "description": "Set which author a publication shows: link an author profile, or set per-publication override fields that win over the profile for this publication only. Pass an empty author_profile_id to clear the link and fall back to the owner name. A publication key can only link profiles its own owner made; the master key can link any profile.",
      "group": "authors",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "author_profile_id",
          "required": false,
          "type": "string",
          "description": "Author profile id; empty string clears the link"
        },
        {
          "name": "author_name",
          "required": false,
          "type": "string",
          "description": "Per-publication override name; empty string clears it"
        },
        {
          "name": "author_avatar_url",
          "required": false,
          "type": "string",
          "description": "Per-publication override avatar URL; empty string clears it"
        },
        {
          "name": "author_bio",
          "required": false,
          "type": "string",
          "description": "Per-publication override bio; empty string clears it"
        }
      ]
    },
    {
      "name": "dispatch_list_collaborators",
      "description": "List the collaborators on one publication, with their role and status. An editor manages issues and settings; an admin also changes the author profile.",
      "group": "authors",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        }
      ]
    },
    {
      "name": "dispatch_add_collaborator",
      "description": "Invite a collaborator: another Wireletter user who manages this publication with the owner. Role 'editor' manages issues and settings; 'admin' also changes the author profile. No invite email is sent yet; the invite email and accept flow are a later step.",
      "group": "authors",
      "auth": "publication",
      "params": [
        {
          "name": "publicationId",
          "required": true,
          "type": "string"
        },
        {
          "name": "email",
          "required": true,
          "type": "string",
          "description": "Email of the Wireletter user to invite"
        },
        {
          "name": "role",
          "required": false,
          "type": "string",
          "description": "'editor' (default) or 'admin'"
        }
      ]
    }
  ]
}
