thincms_create_campaign
Create a campaign record in ThinCMS to store email subject, HTML body, and optional scheduling details, without sending to the mail platform or recipients.
Instructions
Create a campaign record in ThinCMS. This stores the email content; it does NOT push to the connected mail platform (e.g. ActiveCampaign) or deliver to recipients. Use thincms_send_campaign as the second step.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Campaign name | |
| listId | No | Override default list ID | |
| siteId | No | Override the active site for this single call. Pass to target a specific tenant without mutating shared active-site state — the right pattern when running concurrent agent sessions managing different tenants. Must match a siteId from your THINCMS_SITES config (use thincms_list_sites to inspect). When omitted, the call uses the active site set by thincms_switch_site. | |
| subject | Yes | Email subject line | |
| tagFilter | No | Only send to contacts with this tag | |
| htmlContent | Yes | Email HTML body | |
| scheduledAt | No | DEPRECATED — use scheduledFor. ISO 8601 timestamp. | |
| scheduledFor | No | When the campaign should be delivered. Pass "immediate" to push to the mail platform now, or an ISO 8601 timestamp at least 60 minutes in the future to schedule. Omitting this is currently allowed (legacy fallback) but DEPRECATED — Phase 3 will require it. | |
| confirmProductionWrite | No | Acknowledge that this call may write to a configured production site (THINCMS_PRODUCTION_SITE_IDS env var). Required for any POST/PUT/PATCH/DELETE against a production-listed site; ignored otherwise. The error message lists which site triggered the requirement and recommends thincms_snapshot before any production write. |