Typical Automations
- Keep contacts in sync. Push each new signup from your app or website as it happens with Create Contact, or import up to 1,000 at once with Batch Upsert Contacts. Add them to lists with Batch Add List Contacts. Batch Upsert Contacts updates contacts that already exist; Create Contact refuses an address that already exists with a
409. - Mirror unsubscribes. When a user opts out in your app, set
unsubscribed: truewith Update Contact, or unsubscribe from one list with Add or Update a List Contact. - Generate a campaign. Create the campaign from a template with Create Campaign, fill the content from your CMS, send a test with Test Campaign, and schedule it with Send Campaign. The campaign goes through the same checks and review as one made in the dashboard.
- Pull the results. Read the counters and rates with Get Campaign Stats, and the recipients behind a count with List Campaign Recipients. For events as they happen, use webhooks.
API
The Campaigns API overview walks through a campaign from draft to report, with the statuses, the issues and the idempotency rules. The Contacts API and Lists API overviews explain contacts, memberships and consent. You need an API key with thecontacts, lists, campaigns and, for templates, templates scopes; legacy v1 keys cannot be used. See permission scopes. The official Node.js and Go SDKs cover these endpoints.
CLI
The CLI has a command group for each resource:ahasend contacts, ahasend lists and ahasend campaigns, the last one including campaigns templates. Use them for scripts and one-off jobs, such as a nightly import from your database or a test send from a deploy pipeline.

