Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.montereyfinancial.dev/llms.txt

Use this file to discover all available pages before exploring further.

Email campaigns are the central workflow in Monterey. A campaign combines a template, a recipient source (MSSQL query or CSV upload), optional A/B variants, and scheduling configuration.

Campaign CRUD

OperationEndpoint
List campaignsGET /email-campaigns/
Get campaignGET /email-campaigns/{id}
CreatePOST /email-campaigns/
UpdatePUT /email-campaigns/{id}
DeleteDELETE /email-campaigns/{id}
Toggle activePATCH /email-campaigns/{id}/active

Sending a campaign

Trigger a campaign send with:
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -H "workspace_id: <workspace-id>" \
  http://localhost:8000/email-campaigns/{id}/send
This dispatches a Celery background task that:
  1. Queries MSSQL for recipients based on the campaign’s configured query
  2. Suppresses bounced email addresses from the historical bounce list
  3. Syncs the template to Campaigner
  4. Generates an IFUR file for MegaSys automation
  5. Uploads via MegaSys and creates a campaign run with recipient logs

Dry run

Add ?dry_run=true to test the send pipeline without actually dispatching emails:
curl -X POST "http://localhost:8000/email-campaigns/{id}/send?dry_run=true" \
  -H "Authorization: Bearer <token>" \
  -H "workspace_id: <workspace-id>"

CSV recipients

For campaigns using uploaded CSV files instead of MSSQL queries:
EndpointPurpose
POST /email-campaigns/csv/parseParse a CSV file, returns columns and a preview
POST /email-campaigns/{id}/csv/uploadAttach a CSV file to a campaign

Merge field validation

Before sending, validate that your template’s merge fields are resolvable:
curl -X POST http://localhost:8000/email-campaigns/merge-fields/validate \
  -H "Authorization: Bearer <token>" \
  -H "workspace_id: <workspace-id>" \
  -H "Content-Type: application/json" \
  -d '{"template_id": "...", "campaign_id": "..."}'

Schedule parsing

The API can parse natural language schedules into cron expressions using AI:
curl -X POST http://localhost:8000/email-campaigns/schedule/parse \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"text": "every Monday at 9am EST"}'