DOCUMENTATION / CUSTOMERS

Segments and campaigns

Saved segments select people using recorded data. Campaigns send an approved email to a segment. Start with a scoped BARUA_MANAGEMENT_KEY and the installed skill.

Discover what is allowed

node "$BARUA_SKILL/scripts/manage.mjs" capabilities
node "$BARUA_SKILL/scripts/manage.mjs" segments

Segment and campaign list/detail reads need at least one of segment:write, campaign:write or campaign:send. Recipient reads also need people:read. Use the returned capabilities to check your connection.

Success returns the current saved segments. For paginated lists, continue using the returned cursor with --after. Use segment --id to inspect one segment and segment-fields to discover supported fields before building rules.

Create or change an audience

Read Send one campaign to a saved segment before segment or campaign actions. It defines the action inputs and review sequence. Changes go through manage.mjs action with a private JSON input and a stable idempotency key.

Do not guess field names or treat a preview count as a promise to send to every person. Consent and suppression checks still apply at send time.

Review and send

When the campaign checkpoint applies, the owner reviews the exact revision. Only an explicit owner choice delegates sending without that checkpoint. Use campaigns and campaign --id to inspect stored content, then follow the reference's send procedure with the required permission and checkpoints.

Immediate mode skips quiet hours and the marketing gap. Obtain explicit authorization for that exception; urgency alone does not authorize it. Consent and duplicate-send protection still apply.

Campaign approval does not enable lifecycle Plays. Operate Plays covers those separately.

Check the result

Use campaign-job to inspect job progress and campaign-recipients to see recipient outcomes. A queued job is not delivery proof. Use email history for recorded message content and workspace inspection for diagnostics.

If a write times out, retain its idempotency key and read the operation before retrying. Recovery rules explain the safe next step.