Docs Home Log in

Campaigns

A campaign is one offer sent to one audience: a brief, a first email with its follow-ups, and the angles of each email.

Status: the top switch

StatusWhat happens
draftNothing is planned. New campaigns start here.
activeIts emails are planned on the next scheduler run (every minute), only from mailboxes that are active too.
pausedNothing new is planned.

Kata never activates a campaign by itself. Only you, or the agent with your approval, do. set_sending is a shortcut over every campaign: off pauses all active campaigns and cancels the emails already planned; on sets the paused ones back to active. Drafts stay drafts.

An active campaign also has a state, computed on each read: error when it cannot send (no active mailbox it may use, {{link}} in the emails but no Link: line, a brief check that failed, no live angle for the first email, no lead at all), shown as a red badge with the reason; completed when every lead got all its emails (not an error). status and campaign_report return it. The campaign page has a Diagnose button: the agent reads the numbers and lists the 3 to 5 biggest problems, each with one action.

brief.md and company.md

Two memory files guide the AI that writes the emails:

The campaign link is the line Link: https://… in brief.md, and only that line. It is where {{link}} points. update_campaign with target_url is a shortcut that rewrites that line.

check_campaign_brief checks five essentials: target, offer, why care, action, link. It also lists sending checks that do not block: link variables present on the leads, a live angle on each step, and hand-written URLs that will not be tracked.

Need more context? save_context adds files with scope company (used everywhere) or campaign (used for that campaign's emails).

Emails and follow-ups

Step 0 is the first email. Your agent decides how many follow-ups each lead gets and when, lead by lead: there is no fixed rule. To set the timing yourself, set_steps takes the days to wait after the previous email: [3, 5] means first email, follow-up 1 three days later, follow-up 2 five days after that. [] means no follow-up.

  • Follow-ups stay in the same thread and go out from the same mailbox as the first email.
  • Written for each lead. update_campaign with personalize: true (or the switch on the campaign page) writes each first email from an angle and the lead's fields: role, website, notes, any column. Follow-ups are written from what the lead already got.
  • Written by your agent. send_email with campaign_id and list_id sends your agent's own text as that lead's first email in the campaign. The campaign's follow-ups take over.
  • A first email with no live angle waits. A follow-up step with no live angle ends the emails to that lead there.

Variables

VariableValue
{{first_name}}, {{company}}, {{email}}The lead's fields.
{{country}}, {{phone}}…Any other field of the lead (any CSV column or webhook field).
{{sender_name}}, {{sender_first}}The sending mailbox's sender name, and its first word (the company name when the mailbox has none).
{{link}}The campaign link, with the lead's variables filled in and kata=<token> added. Tracked when the mailbox's domain has a link domain.
{{unsubscribe_url}}The lead's unsubscribe link (a mailto when there is no link domain).

When a lead has no value

A variable the lead has no value for prints empty: Hi {{first_name}}, becomes Hi ,. Give a fallback after a |: Hi {{first_name|there}}, prints Hi Anna, for Anna and Hi there, for a lead with no first name. The fallback is plain text, up to 100 characters, with no {, } or | in it. Inside a link, keep it one word. {{link}} and {{unsubscribe_url}} take no fallback: Kata refuses the email.

A variable inside a URL is URL-encoded: sean+ie@x.com becomes sean%2Bie%40x.com. {{x|url}} encodes anywhere; {{x|raw}} never encodes. A URL you write by hand in the body goes out as written: not tracked, no token. Use {{link}} for anything you want measured.

Plain text only

The email reads like a personal note: the text as written, with the HTML part only for the open pixel, images or a layout (opens are tracked on every email by default; turn them off on the campaign for plain text only). The sender name and the signature of the sending mailbox go below (Mailboxes, the ⋯ menu of a mailbox: Sender name, Email signature; or set_mailbox). A mailbox with no sender name, or a placeholder such as “AgentMail”, signs with your company name and the Mailboxes page asks for the real one (Add the sender name). When the body has no unsubscribe link, Kata adds this line:

text
If this isn't relevant, just let me know and I won't write again.

What stops the emails to a lead

  • A reply. Out-of-office replies do not stop it.
  • A hard bounce, an unsubscribe, or a conversion. A soft bounce only delays the email by 24 hours.
  • stop_leads, suppress, or removing the lead from the list that feeds the campaign.
  • An email that failed 3 times in a row (a mailbox or provider problem). Nothing was sent: resume_stopped_leads lists these leads by campaign and puts them back, never one who replied, unsubscribed or bounced.

A lead can be in several campaigns at once: each campaign emails them on its own.

Start at a set time

"Send this Monday at 9:00": give start_at to set_campaign_status (with status active), start_run or send_emails, as a date and time with its zone, for example 2026-11-24T09:00:00+01:00. A time in the past is refused. The campaign sends nothing until then; at that minute Kata starts it by itself, with the same checks as a start by hand, and the emails go out in each lead's local hours. campaign_report and get_run show scheduled_start. cancel_scheduled_start removes it; any other status you set replaces it.

Which mailboxes send

By default a campaign sends from every active mailbox. set_campaign_mailboxes limits it to some. Only new first emails follow the choice: follow-ups stay in the mailbox of their thread.

Deleting

delete_campaign only works on a campaign that never sent. A campaign that sent can be paused, not deleted. Contacts always stay.