Send Test Campaign Invitation
Send the campaign invitation to the author as a disposable test run.
Unlike the in-builder agent preview (which jumps straight into a session),
this exercises the real participant flow end to end: the author receives
the actual invitation email, opens the booking page, and takes the
interview. The minted contact carries the TEST_LAB_DEPARTMENT marker,
so the run is excluded from participant lists, stats, reports, and
insights by construction, is skipped by the completion pipeline, and is
never picked up by the real invitation send.
Works on drafts (the review page finalizes the draft before offering the button) and always sends the email invitation, regardless of the campaign’s delivery channel — Slack/Teams delivery falls back to email for real participants too, so the rendered invitation is authentic.
Runs as a sequence of short transactions, each touching only one row class, on purpose: booking requests lock contact→conversation while a running session’s save locks conversation→contact, so any transaction here that held both would deadlock against one of them. This also keeps the outbound email call outside every conversation lock, and defers the disposal of the previous test run until the new invitation actually went out — a failed send must not destroy anything. A crash between the send and the disposal leaves the old run visible (“already completed” on the emailed link); the next test-send click repairs that state (after the send-claim cooldown of up to _TEST_SEND_COOLDOWN_SECONDS, since the crashed request already claimed its send).
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.