Example 1: Read workspace brand context
Start by reading your workspace’s brand context resource. This gives your AI client access to your brand voice, design instructions, and saved memories before it generates any content.Example 2: List templates and audiences
Before creating anything, check what already exists in your workspace.Example 3: Create an email template
If you do not have a suitable template yet, create one now. Pass the full HTML content for the email body.updated_at. Save the template ID — you will need it to attach the template to a campaign draft.
Example 4: Create a campaign draft
Create a campaign draft using the template and audience IDs from the previous steps. This never sends or schedules anything.updated_at. Save both values — you will need them to update the draft.
Example 5: Update a campaign draft with the concurrency guard
When you update an existing draft, always pass theupdated_at value from your last read. This prevents you from silently overwriting changes made by another session or team member.
updated_at you send does not match the current version on the server, you will receive:
get_campaign to fetch the latest version, re-apply your changes on top of the fresh data, and retry the update.
Example 6: Save an image to your workspace library
If your email references an external image, copy it into your workspace library first so it is reliably hosted.Example 7: Open the campaign for review and delivery
After creating or updating your draft, open it in SendWhale’s UI to run preflight checks, send a test email, confirm your audience, and schedule or send the campaign.<CAMPAIGN_ID> with the ID returned when you created the draft.